Skip to content

Commit

Permalink
Update disk.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
kroese authored Jun 13, 2024
1 parent 4e5cfa4 commit a57b897
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/disk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -458,10 +458,15 @@ 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
error "Invalid value for ${DISK_DESC^^}_SIZE: $DISK_SPACE" && exit 73
fi

if (( DATA_SIZE < 104857600 )); then
error "Please increase ${DISK_DESC^^}_SIZE to at least 100 MB." && exit 73
fi

FS=$(stat -f -c %T "$DIR")
Expand Down

0 comments on commit a57b897

Please sign in to comment.