From f2051e67a3a7ee03254677434a35209beff2225b Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 26 May 2020 13:19:50 +0200 Subject: $MEMORY_NEEDED factorisation --- scripts/restore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/restore') diff --git a/scripts/restore b/scripts/restore index ed0b27d..ae64eaf 100644 --- a/scripts/restore +++ b/scripts/restore @@ -89,9 +89,9 @@ ynh_script_progression --message="Adding swap if needed..." --weight=4 total_memory=$(ynh_get_ram --total) swap_needed=0 -if [ $total_memory -lt 2560 ]; then +if [ $total_memory -lt $MEMORY_NEEDED ]; then # Need a minimum of 8Go of memory - swap_needed=$((2560 - $total_memory)) + swap_needed=$(($MEMORY_NEEDED - $total_memory)) fi ynh_script_progression --message="Adding $swap_needed Mo to swap..." --weight=1 -- cgit v1.2.3-70-g09d2