From: Jocelyn Jaubert Date: Mon, 21 May 2018 20:10:13 +0000 (+0200) Subject: Make it possible to change path used by upgrade.sh on command line X-Git-Tag: v1.0.0-beta.5~9 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b4e5942ca79b8f5702c80197ec40eab8fa053a24;p=oweals%2Fpeertube.git Make it possible to change path used by upgrade.sh on command line --- 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 @@ set -eu -PEERTUBE_PATH=/var/www/peertube/ +PEERTUBE_PATH=${1:-/var/www/peertube/} + +if [ ! -e "$PEERTUBE_PATH" ]; then + echo "Error - path \"$PEERTUBE_PATH\" wasn't found" + echo "" + echo "If peertube was installed in another path, you can specify it with" + echo " ./upgrade.sh " + exit 1 +fi + +if [ ! -e "$PEERTUBE_PATH/versions" -o ! -e "$PEERTUBE_PATH/config/production.yaml" ]; then + echo "Error - Couldn't find peertube installation in \"$PEERTUBE_PATH\"" + echo "" + echo "If peertube was installed in another path, you can specify it with" + echo " ./upgrade.sh " + exit 1 +fi + # Backup database SQL_BACKUP_PATH="$PEERTUBE_PATH/backup/sql-peertube_prod-$(date +"%Y%m%d-%H%M").bak"