Kay0u hace 4 años
padre
commit
e67f5f39c0
Se han modificado 4 ficheros con 9 adiciones y 13 borrados
  1. 2 1
      scripts/install
  2. 3 10
      scripts/remove
  3. 2 1
      scripts/restore
  4. 2 1
      scripts/upgrade

+ 2 - 1
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

+ 3 - 10
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
 
 #=================================================

+ 2 - 1
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

+ 2 - 1
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