Update install.sh

This commit is contained in:
Kroese 2024-01-22 12:03:46 +01:00 committed by GitHub
parent ec6b711b77
commit 5f948ca7af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -122,21 +122,21 @@ if [ ! -f "$ISO" ]; then
fi fi
[ ! -f "$ISO" ] && echo && error "Failed to download $VERSION" && exit 61 [ ! -f "$ISO" ] && error "Failed to download $VERSION" && exit 61
fi fi
SIZE=$(stat -c%s "$ISO") SIZE=$(stat -c%s "$ISO")
SIZE_GB=$(( (SIZE + 1073741823)/1073741824 )) SIZE_GB=$(( (SIZE + 1073741823)/1073741824 ))
if ((SIZE<10000000)); then if ((SIZE<10000000)); then
echo && error "Invalid ISO file: Size is smaller than 10 MB" && exit 62 error "Invalid ISO file: Size is smaller than 10 MB" && exit 62
fi fi
SPACE=$(df --output=avail -B 1 "$TMP" | tail -n 1) SPACE=$(df --output=avail -B 1 "$TMP" | tail -n 1)
SPACE_GB=$(( (SPACE + 1073741823)/1073741824 )) SPACE_GB=$(( (SPACE + 1073741823)/1073741824 ))
if (( SIZE > SPACE )); then if (( SIZE > SPACE )); then
echo && error "Not enough free space in $STORAGE, have $SPACE_GB GB available but need at least $SIZE_GB GB." && exit 63 error "Not enough free space in $STORAGE, have $SPACE_GB GB available but need at least $SIZE_GB GB." && exit 63
fi fi
if [ -n "$CUSTOM" ]; then if [ -n "$CUSTOM" ]; then
@ -293,7 +293,7 @@ SPACE=$(df --output=avail -B 1 "$TMP" | tail -n 1)
SPACE_GB=$(( (SPACE + 1073741823)/1073741824 )) SPACE_GB=$(( (SPACE + 1073741823)/1073741824 ))
if (( SIZE > SPACE )); then if (( SIZE > SPACE )); then
echo && error "Not enough free space in $STORAGE, have $SPACE_GB GB available but need at least $SIZE_GB GB." && exit 63 error "Not enough free space in $STORAGE, have $SPACE_GB GB available but need at least $SIZE_GB GB." && exit 63
fi fi
MSG="Generating new ISO image for installation..." MSG="Generating new ISO image for installation..."