Update disk.sh

This commit is contained in:
Kroese 2024-06-13 11:12:23 +02:00 committed by GitHub
parent 247d7c1f55
commit db8f2bd5ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -422,12 +422,17 @@ addDisk () {
DISK_SPACE=$(echo "${DISK_SPACE^^}" | sed 's/MB/M/g;s/GB/G/g;s/TB/T/g') DISK_SPACE=$(echo "${DISK_SPACE^^}" | sed 's/MB/M/g;s/GB/G/g;s/TB/T/g')
DATA_SIZE=$(numfmt --from=iec "$DISK_SPACE") DATA_SIZE=$(numfmt --from=iec "$DISK_SPACE")
if (( DATA_SIZE < 6442450944 )); then
if (( DATA_SIZE < 1 )); then if (( DATA_SIZE < 1 )); then
error "Invalid value for ${DISK_DESC^^}_SIZE: $DISK_SPACE" && exit 73 error "Invalid value for ${DISK_DESC^^}_SIZE: $DISK_SPACE" && exit 73
else
error "Please increase ${DISK_DESC^^}_SIZE to at least 6 GB." && exit 73
fi 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 fi
FS=$(stat -f -c %T "$DIR") FS=$(stat -f -c %T "$DIR")