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:
parent
9c47591da2
commit
f2051e67a3
4 changed files with 8 additions and 6 deletions
|
@ -13,6 +13,8 @@ BUNDLER_VERSION="1.17.3"
|
|||
|
||||
NODEJS_VERSION="12"
|
||||
|
||||
MEMORY_NEEDED="2560"
|
||||
|
||||
#=================================================
|
||||
# PERSONAL HELPERS
|
||||
#=================================================
|
||||
|
|
|
@ -136,9 +136,9 @@ ynh_script_progression --message="Adding swap is 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 2.5Go 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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -233,9 +233,9 @@ ynh_script_progression --message="Adding swap if needed..." --weight=7
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue