From b8cf96e35a53e16c5efc67fe633d286cd1876012 Mon Sep 17 00:00:00 2001 From: Limezy Date: Mon, 6 Jun 2022 01:35:00 +0700 Subject: [PATCH] Swap --- scripts/install | 6 +++--- scripts/remove | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index c344a68..5f65fbf 100755 --- a/scripts/install +++ b/scripts/install @@ -68,9 +68,9 @@ ynh_app_setting_set --app=$app --key=language --value=$language_key total_memory=$(ynh_get_ram --total) swap_needed=0 -# Need at least 2Go of RAM -if [ $total_memory -lt 3072 ]; then - swap_needed=$((3072 - total_memory)) +# Need at least 1.5Go of RAM to build and run +if [ $total_memory -lt 1536 ]; then + swap_needed=$((1536 - total_memory)) fi if [ $swap_needed -gt 0 ]; then diff --git a/scripts/remove b/scripts/remove index b4c79e2..926a009 100755 --- a/scripts/remove +++ b/scripts/remove @@ -105,6 +105,13 @@ then ynh_exec_warn_less yunohost firewall disallow TCP $port fi +#================================================= +# REMOVE SWAP IF NEEDED +#================================================= +ynh_script_progression --message="Removing swap if needed..." + +ynh_del_swap + #================================================= # SPECIFIC REMOVE #=================================================