diff options
author | Jocelyn Jaubert <jocelyn.jaubert@gmail.com> | 2018-05-21 22:10:13 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-05-22 08:08:40 +0200 |
commit | b4e5942ca79b8f5702c80197ec40eab8fa053a24 (patch) | |
tree | d5eeb814cd16f2017515eb20376a52397301867b | |
parent | ee1219d83d4d3c6c59236c2e854e6b3ff36fa30f (diff) | |
download | PeerTube-b4e5942ca79b8f5702c80197ec40eab8fa053a24.tar.gz PeerTube-b4e5942ca79b8f5702c80197ec40eab8fa053a24.tar.zst PeerTube-b4e5942ca79b8f5702c80197ec40eab8fa053a24.zip |
Make it possible to change path used by upgrade.sh on command line
-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" |