From 576682cda171d4501c61a660f4fca0db484e7279 Mon Sep 17 00:00:00 2001 From: Kroese Date: Fri, 3 May 2024 11:23:23 +0200 Subject: [PATCH] feat: Check RAM amount available (#54) --- src/config.sh | 4 ++-- src/reset.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/config.sh b/src/config.sh index 88e9115..7d35879 100644 --- a/src/config.sh +++ b/src/config.sh @@ -41,10 +41,10 @@ TOTAL_GB=$(( (RAM_TOTAL + 1073741823)/1073741824 )) 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 + exit 17 fi -if (( (RAM_WANTED + 1950000000) > RAM_AVAIL )); then +if (( (RAM_WANTED + 1450000000) > RAM_AVAIL )); then warn "your configured RAM_SIZE of $WANTED_GB GB is much too close to the $AVAIL_GB GB of memory available, please set a lower value." fi diff --git a/src/reset.sh b/src/reset.sh index 4368718..88128c7 100644 --- a/src/reset.sh +++ b/src/reset.sh @@ -83,7 +83,7 @@ echo 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 + exit 17 fi # Helper functions