From 3378b2ed1815643e7772dd71e01fa513d61aeb1d Mon Sep 17 00:00:00 2001 From: Galettofraise Date: Thu, 24 Feb 2022 22:11:14 +0100 Subject: [PATCH 1/3] [fix] Add --purge --- scripts/remove | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/remove b/scripts/remove index 375fca1..a50dd19 100755 --- a/scripts/remove +++ b/scripts/remove @@ -63,6 +63,17 @@ ynh_script_progression --message="Removing app main directory..." # Remove the app directory securely ynh_secure_remove --file="$final_path" +#================================================= +# REMOVE DATA DIR +#================================================= + +# Remove the data directory if --purge option is used +if [ "${YNH_APP_PURGE:-0}" -eq 1 ] +then + ynh_script_progression --message="Removing app data directory..." --time --weight=1 + ynh_secure_remove --file="$datadir" +fi + #================================================= # REMOVE NGINX CONFIGURATION #================================================= From e15fa7f82b46f96539f17ee9524eab007ded8651 Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Sun, 27 Feb 2022 21:32:20 +0100 Subject: [PATCH 2/3] [fix] Remove datadir --- scripts/remove | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/remove b/scripts/remove index a50dd19..d1b8714 100755 --- a/scripts/remove +++ b/scripts/remove @@ -21,6 +21,7 @@ port=$(ynh_app_setting_get --app=$app --key=port) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name final_path=$(ynh_app_setting_get --app=$app --key=final_path) +datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= # STANDARD REMOVE @@ -67,12 +68,10 @@ ynh_secure_remove --file="$final_path" # REMOVE DATA DIR #================================================= -# Remove the data directory if --purge option is used -if [ "${YNH_APP_PURGE:-0}" -eq 1 ] -then - ynh_script_progression --message="Removing app data directory..." --time --weight=1 - ynh_secure_remove --file="$datadir" -fi +# Remove the data directory +# We doesn't support --purge cause it's not relevant here +ynh_script_progression --message="Removing app data directory..." --time --weight=1 +ynh_secure_remove --file="$datadir" #================================================= # REMOVE NGINX CONFIGURATION From 4ee7f86669763d2cf5504fe3ca254e7ea7007d21 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 1 Mar 2022 02:31:26 +0100 Subject: [PATCH 3/3] Fix datadir removal --- scripts/remove | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/remove b/scripts/remove index d1b8714..56b255e 100755 --- a/scripts/remove +++ b/scripts/remove @@ -68,10 +68,12 @@ ynh_secure_remove --file="$final_path" # REMOVE DATA DIR #================================================= -# Remove the data directory -# We doesn't support --purge cause it's not relevant here -ynh_script_progression --message="Removing app data directory..." --time --weight=1 -ynh_secure_remove --file="$datadir" +# Remove the data directory if --purge option is used +if [ "${YNH_APP_PURGE:-0}" -eq 1 ] +then + ynh_script_progression --message="Removing app data directory..." + ynh_secure_remove --file="$datadir" +fi #================================================= # REMOVE NGINX CONFIGURATION