From e67f5f39c0445ab3ada9158be3d556f593f1408c Mon Sep 17 00:00:00 2001 From: Kay0u Date: Tue, 14 Sep 2021 16:51:59 +0200 Subject: [PATCH] fix remove --- scripts/install | 3 ++- scripts/remove | 13 +++---------- scripts/restore | 3 ++- scripts/upgrade | 3 ++- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/scripts/install b/scripts/install index 3ea3036..0608cd4 100644 --- a/scripts/install +++ b/scripts/install @@ -369,7 +369,8 @@ ynh_exec_warn_less /opt/pihole/gravity.sh cp ../conf/dnsmasq_regenconf_hook /usr/share/yunohost/hooks/conf_regen/50-dnsmasq_$app ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="/usr/share/yunohost/hooks/conf_regen/50-dnsmasq_$app" -yunohost tools regen-conf dnsmasq +systemctl daemon-reload +ynh_exec_warn_less yunohost tools regen-conf dnsmasq #================================================= # START PIHOLE-FTL diff --git a/scripts/remove b/scripts/remove index 4888cfa..dc8cffa 100755 --- a/scripts/remove +++ b/scripts/remove @@ -151,11 +151,8 @@ ynh_secure_remove --file="/etc/sudoers.d/pihole" #================================================= ynh_script_progression --message="Removing Dnsmasq config..." --weight=2 -ynh_systemd_action --action=stop --service_name=dnsmasq ynh_secure_remove --file="/etc/dnsmasq.d/03-pihole-wildcard.conf" -ynh_replace_string --match_string="#pihole# " --replace_string="" --target_file=/etc/dnsmasq.conf - #================================================= # CLEAN /etc/hosts #================================================= @@ -171,21 +168,17 @@ sed -i "/#Added by pihole#/d" /etc/hosts # REMOVE CONF_REGEN HOOK #================================================= +ynh_systemd_action --action=stop --service_name=dnsmasq + ynh_secure_remove --file=/usr/share/yunohost/hooks/conf_regen/50-dnsmasq_$app -yunohost tools regen-conf dnsmasq +ynh_exec_warn_less yunohost tools regen-conf dnsmasq #================================================= # RESTART DNSMASQ #================================================= ynh_script_progression --message="Restarting Dnsmasq..." -if [ "$pihole_version" == "Last available" ] -then - # Quietly start dnsmasq a first time, because it usually doesn't start correctly the first time. - ynh_exec_fully_quiet systemctl start dnsmasq - sleep 1 -fi ynh_systemd_action --action=restart --service_name=dnsmasq #================================================= diff --git a/scripts/restore b/scripts/restore index aba0d0a..68981e9 100644 --- a/scripts/restore +++ b/scripts/restore @@ -196,7 +196,8 @@ ynh_script_progression --message="Restoring Dnsmasq config..." test -e "${YNH_APP_BACKUP_DIR}/etc/dnsmasq.d/03-pihole-wildcard.conf" && \ ynh_restore_file --origin_path="/etc/dnsmasq.d/03-pihole-wildcard.conf" -yunohost tools regen-conf dnsmasq +systemctl daemon-reload +ynh_exec_warn_less yunohost tools regen-conf dnsmasq #================================================= # CONFIGURE DNS FOR THE LOCAL DOMAINS diff --git a/scripts/upgrade b/scripts/upgrade index 427fdbe..17e741e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -368,7 +368,8 @@ yunohost service add pihole-FTL --description="PiHole backend service" --log="/v cp ../conf/dnsmasq_regenconf_hook /usr/share/yunohost/hooks/conf_regen/50-dnsmasq_$app ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="/usr/share/yunohost/hooks/conf_regen/50-dnsmasq_$app" -yunohost tools regen-conf dnsmasq +systemctl daemon-reload +ynh_exec_warn_less yunohost tools regen-conf dnsmasq #================================================= # START PIHOLE-FTL