diff options
author | kontrollanten <6680299+kontrollanten@users.noreply.github.com> | 2021-03-29 08:39:43 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-03-29 09:19:11 +0200 |
commit | f076d49f375f07dfbd579a424698b89f1806614f (patch) | |
tree | b574f1cdbba10a57c6615777fd0d105fae366207 | |
parent | 088447758f1ada850157c458dd213f46ef84b88e (diff) | |
download | PeerTube-f076d49f375f07dfbd579a424698b89f1806614f.tar.gz PeerTube-f076d49f375f07dfbd579a424698b89f1806614f.tar.zst PeerTube-f076d49f375f07dfbd579a424698b89f1806614f.zip |
script/upgrade: use db.name config value
-rwxr-xr-x | scripts/upgrade.sh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh index f5f3219af..64a7b18fd 100755 --- a/scripts/upgrade.sh +++ b/scripts/upgrade.sh | |||
@@ -39,8 +39,9 @@ then | |||
39 | DB_PASS=$(node -e "console.log(require('js-yaml').load(fs.readFileSync('$PEERTUBE_PATH/config/production.yaml', 'utf8'))['database']['password'])") | 39 | DB_PASS=$(node -e "console.log(require('js-yaml').load(fs.readFileSync('$PEERTUBE_PATH/config/production.yaml', 'utf8'))['database']['password'])") |
40 | DB_HOST=$(node -e "console.log(require('js-yaml').load(fs.readFileSync('$PEERTUBE_PATH/config/production.yaml', 'utf8'))['database']['hostname'])") | 40 | DB_HOST=$(node -e "console.log(require('js-yaml').load(fs.readFileSync('$PEERTUBE_PATH/config/production.yaml', 'utf8'))['database']['hostname'])") |
41 | DB_SUFFIX=$(node -e "console.log(require('js-yaml').load(fs.readFileSync('$PEERTUBE_PATH/config/production.yaml', 'utf8'))['database']['suffix'])") | 41 | DB_SUFFIX=$(node -e "console.log(require('js-yaml').load(fs.readFileSync('$PEERTUBE_PATH/config/production.yaml', 'utf8'))['database']['suffix'])") |
42 | DB_NAME=$(node -e "console.log(require('js-yaml').load(fs.readFileSync('$PEERTUBE_PATH/config/production.yaml', 'utf8'))['database']['name'] || '')") | ||
42 | mkdir -p $PEERTUBE_PATH/backup | 43 | mkdir -p $PEERTUBE_PATH/backup |
43 | PGPASSWORD=$DB_PASS pg_dump -U $DB_USER -h $DB_HOST -F c "peertube${DB_SUFFIX}" -f "$SQL_BACKUP_PATH" | 44 | PGPASSWORD=$DB_PASS pg_dump -U $DB_USER -h $DB_HOST -F c "${DB_NAME:-'peertube${DB_SUFFIX}'}" -f "$SQL_BACKUP_PATH" |
44 | else | 45 | else |
45 | echo "pg_dump not found. Cannot make a SQL backup!" | 46 | echo "pg_dump not found. Cannot make a SQL backup!" |
46 | fi | 47 | fi |