1
0
Fork 0

Check if awk and sed are executable

This commit is contained in:
Felix Ableitner 2018-12-01 14:00:07 +01:00 committed by Chocobozzz
parent 7593929170
commit 5c94c38d18
1 changed files with 9 additions and 7 deletions

View File

@ -20,6 +20,7 @@ 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
@ -28,6 +29,7 @@ if [ "$REMAINING" -lt "$ONE_GB" ]; then
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"