From 685d56e07a89d547f38f306fa91442c20efb08fd Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 31 Aug 2022 04:24:01 +0200 Subject: [PATCH] Disable swap during package_check --- scripts/install | 4 +++- scripts/remove | 4 +++- scripts/restore | 4 +++- scripts/upgrade | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index c41c2a5..6242910 100755 --- a/scripts/install +++ b/scripts/install @@ -133,7 +133,9 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Adding swap..." -ynh_add_swap --size=$swap_needed +if [ ${PACKAGE_CHECK_EXEC:-0} -eq 0 ]; then + ynh_add_swap --size=$swap_needed +fi #================================================= # CREATE DATA DIRECTORY diff --git a/scripts/remove b/scripts/remove index ae18adb..57712e8 100755 --- a/scripts/remove +++ b/scripts/remove @@ -168,7 +168,9 @@ ynh_secure_remove --file="/var/log/$app" #================================================= ynh_script_progression --message="Removing swap..." -ynh_del_swap +if [ ${PACKAGE_CHECK_EXEC:-0} -eq 0 ]; then + ynh_del_swap +fi #================================================= # GENERIC FINALIZATION diff --git a/scripts/restore b/scripts/restore index fcb1706..bb6855a 100755 --- a/scripts/restore +++ b/scripts/restore @@ -191,7 +191,9 @@ ynh_restore_file --origin_path="/etc/cron.d/$app" #================================================= ynh_script_progression --message="Adding swap..." -ynh_add_swap --size=$swap_needed +if [ ${PACKAGE_CHECK_EXEC:-0} -eq 0 ]; then + ynh_add_swap --size=$swap_needed +fi #================================================= # RESTORE SYSTEMD diff --git a/scripts/upgrade b/scripts/upgrade index b986697..880ca53 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -304,7 +304,9 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Adding swap..." -ynh_add_swap --size=$swap_needed +if [ ${PACKAGE_CHECK_EXEC:-0} -eq 0 ]; then + ynh_add_swap --size=$swap_needed +fi #================================================= # UPDATE A CONFIG FILE