From 8bfbef0c16d47d8c9ba45e3a63d314dc82c6fcca Mon Sep 17 00:00:00 2001 From: Kroese Date: Fri, 3 May 2024 11:04:34 +0200 Subject: [PATCH] feat: Check memory available --- src/reset.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/reset.sh b/src/reset.sh index faa7a9d..0bf33a2 100644 --- a/src/reset.sh +++ b/src/reset.sh @@ -86,15 +86,11 @@ echo # Check memory -if (( RAM_WANTED > RAM_AVAIL )); then - error "Your configured RAM_SIZE of $WANTED_GB GB is higher than the $AVAIL_GB GB of memory available." +if (( (RAM_WANTED + 500000000) > RAM_AVAIL )); then + error "Your configured RAM_SIZE of $WANTED_GB GB is higher than the $AVAIL_GB GB of memory available, please set a lower value." exit 15 fi -if (( (RAM_WANTED + 1950000000) > RAM_AVAIL )); then - warn "your configured RAM_SIZE of $WANTED_GB GB is much too close to the $AVAIL_GB GB of memory available." -fi - # Cleanup files rm -f /run/shm/qemu.* rm -f /run/shm/dsm.url