From e526f969a97d83e41d29edbfdf6f40c7e5f24e83 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Sat, 8 Feb 2020 23:34:06 +0100 Subject: [PATCH] scripts: remove the service before removing the systemd config Yunohost complains if the systemd unit doesn't exist when removing the service. --- scripts/remove | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/scripts/remove b/scripts/remove index ed12aff..fb9dbda 100755 --- a/scripts/remove +++ b/scripts/remove @@ -24,6 +24,15 @@ logs_path="/var/log/$app" #================================================= # STANDARD REMOVE +#================================================= +#================================================= +# REMOVE SERVICE FROM ADMIN PANEL +#================================================= + +if sudo yunohost service status | grep -q "$app"; then + sudo yunohost service remove "$app" +fi + #================================================= # STOP AND REMOVE SERVICE #================================================= @@ -40,14 +49,6 @@ if [ -f "/etc/supervisor/conf.d/${app}.conf" ]; then sudo ynh_secure_remove --file="/etc/supervisor/conf.d/${app}.conf" fi -#================================================= -# REMOVE SERVICE FROM ADMIN PANEL -#================================================= - -if sudo yunohost service status | grep -q "$app"; then - sudo yunohost service remove "$app" -fi - #================================================= # REMOVE THE MYSQL DATABASE #=================================================