diff options
-rwxr-xr-x | scripts/upgrade.sh | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh index abb7e9414..295e16bfd 100755 --- a/scripts/upgrade.sh +++ b/scripts/upgrade.sh | |||
@@ -2,7 +2,24 @@ | |||
2 | 2 | ||
3 | set -eu | 3 | set -eu |
4 | 4 | ||
5 | PEERTUBE_PATH=/var/www/peertube/ | 5 | PEERTUBE_PATH=${1:-/var/www/peertube/} |
6 | |||
7 | if [ ! -e "$PEERTUBE_PATH" ]; then | ||
8 | echo "Error - path \"$PEERTUBE_PATH\" wasn't found" | ||
9 | echo "" | ||
10 | echo "If peertube was installed in another path, you can specify it with" | ||
11 | echo " ./upgrade.sh <PATH>" | ||
12 | exit 1 | ||
13 | fi | ||
14 | |||
15 | if [ ! -e "$PEERTUBE_PATH/versions" -o ! -e "$PEERTUBE_PATH/config/production.yaml" ]; then | ||
16 | echo "Error - Couldn't find peertube installation in \"$PEERTUBE_PATH\"" | ||
17 | echo "" | ||
18 | echo "If peertube was installed in another path, you can specify it with" | ||
19 | echo " ./upgrade.sh <PATH>" | ||
20 | exit 1 | ||
21 | fi | ||
22 | |||
6 | 23 | ||
7 | # Backup database | 24 | # Backup database |
8 | SQL_BACKUP_PATH="$PEERTUBE_PATH/backup/sql-peertube_prod-$(date +"%Y%m%d-%H%M").bak" | 25 | SQL_BACKUP_PATH="$PEERTUBE_PATH/backup/sql-peertube_prod-$(date +"%Y%m%d-%H%M").bak" |