1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pihole_ynh.git synced 2024-09-03 20:05:58 +02:00

fix remove

This commit is contained in:
Kay0u 2021-09-14 16:51:59 +02:00
parent 452c6b664d
commit e67f5f39c0
No known key found for this signature in database
GPG key ID: AAFEEB16CFA2AE2D
4 changed files with 9 additions and 13 deletions

View file

@ -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 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" 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 # START PIHOLE-FTL

View file

@ -151,11 +151,8 @@ ynh_secure_remove --file="/etc/sudoers.d/pihole"
#================================================= #=================================================
ynh_script_progression --message="Removing Dnsmasq config..." --weight=2 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_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 # CLEAN /etc/hosts
#================================================= #=================================================
@ -171,21 +168,17 @@ sed -i "/#Added by pihole#/d" /etc/hosts
# REMOVE CONF_REGEN HOOK # 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 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 # RESTART DNSMASQ
#================================================= #=================================================
ynh_script_progression --message="Restarting 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 ynh_systemd_action --action=restart --service_name=dnsmasq
#================================================= #=================================================

View file

@ -196,7 +196,8 @@ ynh_script_progression --message="Restoring Dnsmasq config..."
test -e "${YNH_APP_BACKUP_DIR}/etc/dnsmasq.d/03-pihole-wildcard.conf" && \ 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" 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 # CONFIGURE DNS FOR THE LOCAL DOMAINS

View file

@ -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 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" 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 # START PIHOLE-FTL