From 86dc0b9cc9374cba7548bb613ff43d92f90570a8 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 28 May 2021 15:54:18 +0200 Subject: [PATCH] Fix upgrade script --- scripts/upgrade.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh index 64a7b18fd..12629ad65 100755 --- a/scripts/upgrade.sh +++ b/scripts/upgrade.sh @@ -33,15 +33,15 @@ fi # Backup database if [ -x "$(command -v pg_dump)" ] -then - SQL_BACKUP_PATH="$PEERTUBE_PATH/backup/sql-peertube_prod-$(date +"%Y%m%d-%H%M").bak" +then + SQL_BACKUP_PATH="$PEERTUBE_PATH/backup/sql-peertube_prod-$(date +"%Y%m%d-%H%M").bak" DB_USER=$(node -e "console.log(require('js-yaml').load(fs.readFileSync('$PEERTUBE_PATH/config/production.yaml', 'utf8'))['database']['username'])") DB_PASS=$(node -e "console.log(require('js-yaml').load(fs.readFileSync('$PEERTUBE_PATH/config/production.yaml', 'utf8'))['database']['password'])") DB_HOST=$(node -e "console.log(require('js-yaml').load(fs.readFileSync('$PEERTUBE_PATH/config/production.yaml', 'utf8'))['database']['hostname'])") DB_SUFFIX=$(node -e "console.log(require('js-yaml').load(fs.readFileSync('$PEERTUBE_PATH/config/production.yaml', 'utf8'))['database']['suffix'])") DB_NAME=$(node -e "console.log(require('js-yaml').load(fs.readFileSync('$PEERTUBE_PATH/config/production.yaml', 'utf8'))['database']['name'] || '')") mkdir -p $PEERTUBE_PATH/backup - PGPASSWORD=$DB_PASS pg_dump -U $DB_USER -h $DB_HOST -F c "${DB_NAME:-'peertube${DB_SUFFIX}'}" -f "$SQL_BACKUP_PATH" + PGPASSWORD=$DB_PASS pg_dump -U $DB_USER -h $DB_HOST -F c "${DB_NAME:-peertube${DB_SUFFIX}}" -f "$SQL_BACKUP_PATH" else echo "pg_dump not found. Cannot make a SQL backup!" fi @@ -72,7 +72,7 @@ rm -f "peertube-${VERSION}.zip" rm -rf $PEERTUBE_PATH/peertube-latest ln -s "$PEERTUBE_PATH/versions/peertube-${VERSION}" $PEERTUBE_PATH/peertube-latest cd $PEERTUBE_PATH/peertube-latest -yarn install --production --pure-lockfile +yarn install --production --pure-lockfile cp $PEERTUBE_PATH/peertube-latest/config/default.yaml $PEERTUBE_PATH/config/default.yaml echo "Differences in configuration files..."