X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=scripts%2Fupgrade.sh;h=295e16bfd1e98f6a137c8376da31ef8af112433a;hb=469b29087bd8f98d87a32b87dacb346b6bf61db1;hp=abb7e94147def87841a22dceb68531c7d6255b49;hpb=ee1219d83d4d3c6c59236c2e854e6b3ff36fa30f;p=github%2FChocobozzz%2FPeerTube.git 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"