diff options
-rwxr-xr-x | scripts/upgrade.sh | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh index 295e16bfd..0ff755b45 100755 --- a/scripts/upgrade.sh +++ b/scripts/upgrade.sh | |||
@@ -26,9 +26,21 @@ SQL_BACKUP_PATH="$PEERTUBE_PATH/backup/sql-peertube_prod-$(date +"%Y%m%d-%H%M"). | |||
26 | mkdir -p $PEERTUBE_PATH/backup | 26 | mkdir -p $PEERTUBE_PATH/backup |
27 | pg_dump -U peertube -W -h localhost -F c peertube_prod -f "$SQL_BACKUP_PATH" | 27 | pg_dump -U peertube -W -h localhost -F c peertube_prod -f "$SQL_BACKUP_PATH" |
28 | 28 | ||
29 | # Get and Display the Latest Version | 29 | # If there is a pre-release, give the user a choice which one to install. |
30 | VERSION=$(curl -s https://api.github.com/repos/chocobozzz/peertube/releases/latest | grep tag_name | cut -d '"' -f 4) | 30 | RELEASE_VERSION=$(curl -s https://api.github.com/repos/chocobozzz/peertube/releases/latest | grep tag_name | cut -d '"' -f 4) |
31 | echo "Latest Peertube version is $VERSION" | 31 | PRE_RELEASE_VERSION=$(curl -s https://api.github.com/repos/chocobozzz/peertube/releases | grep tag_name | head -1 | cut -d '"' -f 4) |
32 | |||
33 | if [ "$RELEASE_VERSION" != "$PRE_RELEASE_VERSION" ]; then | ||
34 | echo -e "Which version do you want to install?\n[1] $RELEASE_VERSION (stable) \n[2] $PRE_RELEASE_VERSION (pre-release)" | ||
35 | read choice | ||
36 | case $choice in | ||
37 | [1]* ) VERSION="$RELEASE_VERSION";; | ||
38 | [2]* ) VERSION="$PRE_RELEASE_VERSION";; | ||
39 | * ) exit; | ||
40 | esac | ||
41 | fi | ||
42 | |||
43 | echo "Installing Peertube version $VERSION" | ||
32 | wget -q "https://github.com/Chocobozzz/PeerTube/releases/download/${VERSION}/peertube-${VERSION}.zip" -O "$PEERTUBE_PATH/versions/peertube-${VERSION}.zip" | 44 | wget -q "https://github.com/Chocobozzz/PeerTube/releases/download/${VERSION}/peertube-${VERSION}.zip" -O "$PEERTUBE_PATH/versions/peertube-${VERSION}.zip" |
33 | cd $PEERTUBE_PATH/versions | 45 | cd $PEERTUBE_PATH/versions |
34 | unzip -o "peertube-${VERSION}.zip" | 46 | unzip -o "peertube-${VERSION}.zip" |