From d37713e8e3820764ea678ed5d29e2d27c2ed4cf1 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 7 Dec 2021 19:21:18 +0100 Subject: [PATCH] Add purge option for datadir --- scripts/remove | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/remove b/scripts/remove index 318ce53..21230eb 100644 --- a/scripts/remove +++ b/scripts/remove @@ -74,6 +74,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..." + ynh_secure_remove --file="$datadir" +fi + #================================================= # REMOVE NGINX CONFIGURATION #=================================================