diff options
author | Felix Ableitner <me@nutomic.com> | 2018-12-01 14:00:07 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-12-04 09:31:36 +0100 |
commit | 5c94c38d18a02864b6f384bcd829a0d3f2d86c4a (patch) | |
tree | 5457539daa5fe9582460bc7e2c7c7070b3302810 | |
parent | 75939291703cf18010495f6b85d6d65e01184235 (diff) | |
download | PeerTube-5c94c38d18a02864b6f384bcd829a0d3f2d86c4a.tar.gz PeerTube-5c94c38d18a02864b6f384bcd829a0d3f2d86c4a.tar.zst PeerTube-5c94c38d18a02864b6f384bcd829a0d3f2d86c4a.zip |
Check if awk and sed are executable
-rwxr-xr-x | scripts/upgrade.sh | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh index 0a9ce1dab..4f7c58edd 100755 --- a/scripts/upgrade.sh +++ b/scripts/upgrade.sh | |||
@@ -20,13 +20,15 @@ if [ ! -e "$PEERTUBE_PATH/versions" -o ! -e "$PEERTUBE_PATH/config/production.ya | |||
20 | exit 1 | 20 | exit 1 |
21 | fi | 21 | fi |
22 | 22 | ||
23 | REMAINING=$(df -k $PEERTUBE_PATH | awk '{ print $4}' | sed -n 2p) | 23 | if [ -x "$(command -v awk)" ] && [ -x "$(command -v sed)" ] ; then |
24 | ONE_GB=$((1024 * 1024)) | 24 | REMAINING=$(df -k $PEERTUBE_PATH | awk '{ print $4}' | sed -n 2p) |
25 | if [ "$REMAINING" -lt "$ONE_GB" ]; then | 25 | ONE_GB=$((1024 * 1024)) |
26 | echo "Error - not enough free space for upgrading" | 26 | if [ "$REMAINING" -lt "$ONE_GB" ]; then |
27 | echo "" | 27 | echo "Error - not enough free space for upgrading" |
28 | echo "Make sure you have at least 1 GB of free space in $PEERTUBE_PATH" | 28 | echo "" |
29 | exit 1 | 29 | echo "Make sure you have at least 1 GB of free space in $PEERTUBE_PATH" |
30 | exit 1 | ||
31 | fi | ||
30 | fi | 32 | fi |
31 | 33 | ||
32 | # Backup database | 34 | # Backup database |