From b36ebe8fd081cf7498bc2b86fdb4945b76e0a644 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Holcroft Date: Thu, 21 Sep 2017 14:48:29 +0200 Subject: [PATCH] Improve removal script --- scripts/remove | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/scripts/remove b/scripts/remove index 9a1aae5..21d9f2a 100755 --- a/scripts/remove +++ b/scripts/remove @@ -23,12 +23,20 @@ db_name=$(ynh_app_setting_get $app db_name) # REMOVE SERVICE FROM ADMIN PANEL #================================================= -if yunohost service status | grep -q $app +if yunohost service status | grep -q "$app" then echo "Remove $app service" - yunohost service remove $app.service + systemctl stop "$app.service" + yunohost service remove "$app.service" fi +#================================================= +# REMOVE THE PostgreSQL DATABASE +#================================================= + +# Remove a database if it exists, along with the associated user +ynh_psql_remove_db "$db_name" "$app" + #================================================= # REMOVE DEPENDENCIES #================================================= @@ -36,13 +44,6 @@ fi # Remove metapackage and its dependencies ynh_remove_app_dependencies -#================================================= -# REMOVE THE PostgreSQL DATABASE -#================================================= - -# Remove a database if it exists, along with the associated user -ynh_psql_remove_db $db_name $app - #================================================= # REMOVE APP MAIN DIR #=================================================