1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/glitchsoc_ynh.git synced 2024-09-03 19:15:59 +02:00

$MEMORY_NEEDED factorisation

This commit is contained in:
yalh76 2020-05-26 13:19:50 +02:00
parent 9c47591da2
commit f2051e67a3
4 changed files with 8 additions and 6 deletions

View file

@ -13,6 +13,8 @@ BUNDLER_VERSION="1.17.3"
NODEJS_VERSION="12" NODEJS_VERSION="12"
MEMORY_NEEDED="2560"
#================================================= #=================================================
# PERSONAL HELPERS # PERSONAL HELPERS
#================================================= #=================================================

View file

@ -136,9 +136,9 @@ ynh_script_progression --message="Adding swap is needed..." --weight=4
total_memory=$(ynh_get_ram --total) total_memory=$(ynh_get_ram --total)
swap_needed=0 swap_needed=0
if [ $total_memory -lt 2560 ]; then if [ $total_memory -lt $MEMORY_NEEDED ]; then
# Need a minimum of 2.5Go of memory # Need a minimum of 2.5Go of memory
swap_needed=$((2560 - $total_memory)) swap_needed=$(($MEMORY_NEEDED - $total_memory))
fi fi
ynh_script_progression --message="Adding $swap_needed Mo to swap..." --weight=1 ynh_script_progression --message="Adding $swap_needed Mo to swap..." --weight=1

View file

@ -89,9 +89,9 @@ ynh_script_progression --message="Adding swap if needed..." --weight=4
total_memory=$(ynh_get_ram --total) total_memory=$(ynh_get_ram --total)
swap_needed=0 swap_needed=0
if [ $total_memory -lt 2560 ]; then if [ $total_memory -lt $MEMORY_NEEDED ]; then
# Need a minimum of 8Go of memory # Need a minimum of 8Go of memory
swap_needed=$((2560 - $total_memory)) swap_needed=$(($MEMORY_NEEDED - $total_memory))
fi fi
ynh_script_progression --message="Adding $swap_needed Mo to swap..." --weight=1 ynh_script_progression --message="Adding $swap_needed Mo to swap..." --weight=1

View file

@ -233,9 +233,9 @@ ynh_script_progression --message="Adding swap if needed..." --weight=7
total_memory=$(ynh_get_ram --total) total_memory=$(ynh_get_ram --total)
swap_needed=0 swap_needed=0
if [ $total_memory -lt 2560 ]; then if [ $total_memory -lt $MEMORY_NEEDED ]; then
# Need a minimum of 8Go of memory # Need a minimum of 8Go of memory
swap_needed=$((2560 - $total_memory)) swap_needed=$(($MEMORY_NEEDED - $total_memory))
fi fi
ynh_script_progression --message="Adding $swap_needed Mo to swap..." --weight=1 ynh_script_progression --message="Adding $swap_needed Mo to swap..." --weight=1