From 64bdedb706d51f0bf40a31d805b18fdc411a3092 Mon Sep 17 00:00:00 2001 From: Galettofraise Date: Wed, 23 Feb 2022 18:46:59 +0100 Subject: [PATCH 1/3] [fix] Add --purge --- scripts/remove | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/remove b/scripts/remove index 1b12a17..61f2713 100644 --- a/scripts/remove +++ b/scripts/remove @@ -73,6 +73,12 @@ ynh_script_progression --message="Removing app data directory..." --weight=1 # Remove the app directory securely ynh_secure_remove --file="/home/yunohost.app/$app" +# 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 CRON FILE #================================================= From b0307f94354eb0c05bfa00a213fb2f789371155f Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Sun, 27 Feb 2022 21:40:42 +0100 Subject: [PATCH 2/3] [fix] IN this case we want remove datadir in every situation --- scripts/remove | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/scripts/remove b/scripts/remove index 61f2713..bf67d5d 100644 --- a/scripts/remove +++ b/scripts/remove @@ -71,14 +71,8 @@ ynh_remove_fpm_config ynh_script_progression --message="Removing app data directory..." --weight=1 # Remove the app directory securely -ynh_secure_remove --file="/home/yunohost.app/$app" +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..." --time --weight=1 - ynh_secure_remove --file="$datadir" -fi #================================================= # REMOVE THE CRON FILE #================================================= From 5e9d882afec58520a4ee1101ed3579a2d9f6dbf8 Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Sun, 27 Feb 2022 21:41:17 +0100 Subject: [PATCH 3/3] [fix] Missing var --- scripts/remove | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/remove b/scripts/remove index bf67d5d..8ff3cd4 100644 --- a/scripts/remove +++ b/scripts/remove @@ -20,6 +20,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) 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