|
|
@@ -229,12 +229,22 @@ if [ "$pihole_version" == "Last 3.X" ]
|
|
|
then
|
|
|
# Version 3.3.1
|
|
|
cp -a $pihole_local_repo/advanced/pihole-FTL.service /etc/init.d/pihole-FTL
|
|
|
- chmod +x /etc/init.d/q
|
|
|
+ chmod +x /etc/init.d/pihole-FTL
|
|
|
ynh_exec_warn_less systemctl enable pihole-FTL
|
|
|
else
|
|
|
# Last version available
|
|
|
# Stopped dnsmasq to replace it by pihole-FTL
|
|
|
ynh_systemd_action --action=stop --service_name=dnsmasq
|
|
|
+
|
|
|
+systemctl disable dnsmasq
|
|
|
+# rm /lib/systemd/system/dnsmasq.service
|
|
|
+mv /lib/systemd/system/dnsmasq.service /lib/systemd/system/.dnsmasq.service
|
|
|
+# rm /etc/init.d/dnsmasq
|
|
|
+mv /etc/init.d/dnsmasq /etc/init.d/.dnsmasq
|
|
|
+
|
|
|
+ cp -a $pihole_local_repo/advanced/Templates/pihole-FTL.service /etc/init.d/pihole-FTL
|
|
|
+ chmod +x /etc/init.d/pihole-FTL
|
|
|
+ ynh_exec_warn_less systemctl enable pihole-FTL
|
|
|
# Move dnsmasq to preserve the current version
|
|
|
mv /usr/sbin/dnsmasq /usr/sbin/dnsmasq.backup_by_pihole
|
|
|
# Replace dnsmasq by pihole-FTL
|
|
|
@@ -242,6 +252,36 @@ else
|
|
|
# https://github.com/pi-hole/FTL/tree/master/dnsmasq
|
|
|
update-alternatives --install /usr/sbin/dnsmasq dnsmasq /usr/bin/pihole-FTL 50
|
|
|
update-alternatives --install /usr/sbin/dnsmasq dnsmasq /usr/sbin/dnsmasq.backup_by_pihole 40
|
|
|
+
|
|
|
+# cp /etc/init.d/pihole-FTL /etc/init.d/dnsmasq
|
|
|
+# systemctl enable dnsmasq
|
|
|
+
|
|
|
+# ln --symbolic /run/pihole-FTL.pid /run/dnsmasq/dnsmasq.pid
|
|
|
+
|
|
|
+# lrwxrwxrwx 1 root root 35 Jun 22 2018 /etc/systemd/system/multi-user.target.wants/dnsmasq.service -> /lib/systemd/system/dnsmasq.service
|
|
|
+# /run/systemd/generator.late/pihole-FTL.service
|
|
|
+sudo ln -s /run/systemd/generator.late/pihole-FTL.service /etc/systemd/system/multi-user.target.wants/dnsmasq.service
|
|
|
+sudo systemctl daemon-reload
|
|
|
+
|
|
|
+# sudo yunohost app install github/pihole_ynh/ --args "admin=mcrudelis&pihole_version=Last available&" -f -n
|
|
|
+
|
|
|
+# >>> It does work, as we have both dnsmasq and pihole-FTL as the same.
|
|
|
+# But no more dns resolution...
|
|
|
+
|
|
|
+# sudo systemctl daemon-reload
|
|
|
+
|
|
|
+# /lib/systemd/system/dnsmasq.service
|
|
|
+# /etc/init.d/dnsmasq
|
|
|
+
|
|
|
+# systemctl stop dnsmasq
|
|
|
+# systemctl disable dnsmasq
|
|
|
+# If I remove /lib/systemd/system/dnsmasq.service and /etc/init.d/dnsmasq, it works.
|
|
|
+# sudo systemctl daemon-reload
|
|
|
+
|
|
|
+# But we don't have dnsmasq anymore...
|
|
|
+# Duplicating /etc/init.d/pihole-FTL in /etc/init.d/dnsmasq does work
|
|
|
+
|
|
|
+
|
|
|
fi
|
|
|
|
|
|
#=================================================
|
|
|
@@ -273,7 +313,7 @@ ynh_store_file_checksum --file="$setupVars"
|
|
|
#=================================================
|
|
|
ynh_script_progression --message="Setting up Dnsmasq config..." --weight=2
|
|
|
|
|
|
-ynh_systemd_action --action=stop --service_name=dnsmasq
|
|
|
+# ynh_systemd_action --action=stop --service_name=dnsmasq
|
|
|
|
|
|
pihole_dnsmasq_config="/etc/dnsmasq.d/01-pihole.conf"
|
|
|
cp "$pihole_local_repo/advanced/01-pihole.conf" $pihole_dnsmasq_config
|
|
|
@@ -374,7 +414,7 @@ ynh_replace_string --match_string=".*updatechecker.*" --replace_string="#&" --ta
|
|
|
#=================================================
|
|
|
ynh_script_progression --message="Restarting Dnsmasq..." --weight=2
|
|
|
|
|
|
-ynh_systemd_action --action=restart --service_name=dnsmasq
|
|
|
+# ynh_systemd_action --action=restart --service_name=dnsmasq
|
|
|
|
|
|
#=================================================
|
|
|
# START PIHOLE-FTL
|
|
|
@@ -387,6 +427,8 @@ then
|
|
|
ynh_systemd_action --action=restart --service_name=pihole-FTL
|
|
|
fi
|
|
|
|
|
|
+sleep 5
|
|
|
+
|
|
|
#=================================================
|
|
|
# BUILD THE LISTS WITH GRAVITY
|
|
|
#=================================================
|