X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=scripts%2Fupgrade.sh;h=5d7c5b0eaa73629ad2138f5355ab9f5cc133510f;hb=97567dd81f508dd6295ac4d73d849aa2ce0a6549;hp=c70b3b42a8bdc608b1c3ea3961462de10135561a;hpb=6d8c8ea73a774c3568e6d28a4cbebcf7979d5c2a;p=github%2FChocobozzz%2FPeerTube.git diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh index c70b3b42a..5d7c5b0ea 100755 --- a/scripts/upgrade.sh +++ b/scripts/upgrade.sh @@ -20,6 +20,16 @@ if [ ! -e "$PEERTUBE_PATH/versions" -o ! -e "$PEERTUBE_PATH/config/production.ya exit 1 fi +if [ -x "$(command -v awk)" ] && [ -x "$(command -v sed)" ] ; then + REMAINING=$(df -k $PEERTUBE_PATH | awk '{ print $4}' | sed -n 2p) + ONE_GB=$((1024 * 1024)) + if [ "$REMAINING" -lt "$ONE_GB" ]; then + echo "Error - not enough free space for upgrading" + echo "" + echo "Make sure you have at least 1 GB of free space in $PEERTUBE_PATH" + exit 1 + fi +fi # Backup database SQL_BACKUP_PATH="$PEERTUBE_PATH/backup/sql-peertube_prod-$(date +"%Y%m%d-%H%M").bak" @@ -63,3 +73,7 @@ cp $PEERTUBE_PATH/peertube-latest/config/default.yaml $PEERTUBE_PATH/config/defa echo "Differences in configuration files..." diff -u $PEERTUBE_PATH/config/production.yaml "$PEERTUBE_PATH/versions/peertube-${VERSION}/config/production.yaml.example" +echo "" +echo "===========================================" +echo "== Don’t forget to restart PeerTube! ==" +echo "==========================================="