Update disk.sh

This commit is contained in:
Kroese 2024-06-13 18:57:55 +02:00 committed by GitHub
parent db8f2bd5ed
commit 758d67c122
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -420,17 +420,13 @@ addDisk () {
[ -z "$DISK_SPACE" ] && DISK_SPACE="16G"
DISK_SPACE=$(echo "${DISK_SPACE^^}" | sed 's/MB/M/g;s/GB/G/g;s/TB/T/g')
[[ -z "${DISK_SPACE//[0-9]}" ]] && DISK_SPACE="${DISK_SPACE}G"
DATA_SIZE=$(numfmt --from=iec "$DISK_SPACE")
if (( DATA_SIZE < 1 )); then
error "Invalid value for ${DISK_DESC^^}_SIZE: $DISK_SPACE" && exit 73
fi
if (( DATA_SIZE < 1000 )); then
DISK_SPACE="${DISK_SPACE}G"
DATA_SIZE=$(numfmt --from=iec "$DISK_SPACE")
fi
if (( DATA_SIZE < 6442450944 )); then
error "Please increase ${DISK_DESC^^}_SIZE to at least 6 GB." && exit 73
fi