From 685140d800a6cbabaf0b1f8bec502c4e1d8a4f1f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 16 Nov 2021 10:06:41 +0100 Subject: [PATCH] Update remove --- scripts/remove | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/remove b/scripts/remove index 5254aeb..4644a96 100755 --- a/scripts/remove +++ b/scripts/remove @@ -19,6 +19,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) port=$(ynh_app_setting_get --app=$app --key=port) final_path=$(ynh_app_setting_get --app=$app --key=final_path) +datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= # STANDARD REMOVE @@ -57,6 +58,17 @@ ynh_script_progression --message="Removing app main directory and database..." - # 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..." --weight=1 + ynh_secure_remove --file="$datadir" +fi + #================================================= # REMOVE NGINX CONFIGURATION #=================================================