From fb852d4bc8a141ae6189e812fb9f4541007a4b48 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Tue, 12 Oct 2021 13:39:54 +0200 Subject: [PATCH] Add purge option to remove --- manifest.json | 2 +- scripts/remove | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/manifest.json b/manifest.json index bdc653d..cdf5abc 100644 --- a/manifest.json +++ b/manifest.json @@ -13,7 +13,7 @@ "email": "pierre@kayou.io" }, "requirements": { - "yunohost": ">= 4.1.3" + "yunohost": ">= 4.2.8" }, "multi_instance": false, "services": [ diff --git a/scripts/remove b/scripts/remove index 8a814d4..e3b5630 100755 --- a/scripts/remove +++ b/scripts/remove @@ -91,10 +91,15 @@ ynh_script_progression --message="Removing the dedicated system user..." ynh_system_user_delete --username=$app #================================================= -# INFO TO REMOVE CONTAINERS +# REMOVE CONTAINERS #================================================= -ynh_print_warn --message="If you really want to delete all containers and files related to lxd please run \"rm /var/lib/lxd -rf\"" +# Remove the data directory if --purge option is used +if [ "${YNH_APP_PURGE:-0}" -eq 1 ] +then + ynh_script_progression --message="Removing containers..." + ynh_secure_remove --file="/var/lib/lxd" +fi #================================================= # END OF SCRIPT