From 2f4b7ce3dd3749acc5513ab63214cdd38f265609 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 12 Dec 2016 14:16:13 +0100 Subject: [PATCH] Update dnsmasq file when changing upstream DNS servers and restart the service to get it active --- advanced/Scripts/webpage.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/advanced/Scripts/webpage.sh b/advanced/Scripts/webpage.sh index 4df11f38..6ae2c327 100755 --- a/advanced/Scripts/webpage.sh +++ b/advanced/Scripts/webpage.sh @@ -65,6 +65,14 @@ SetDNSServers(){ echo "PIHOLE_DNS_1=${args[2]}" >> /etc/pihole/setupVars.conf echo "PIHOLE_DNS_2=${args[3]}" >> /etc/pihole/setupVars.conf + # Replace within actual dnsmasq config file + sed -i '/server=/d;' /etc/dnsmasq.d/01-pihole.conf + echo "server=${args[2]}" >> /etc/dnsmasq.d/01-pihole.conf + echo "server=${args[3]}" >> /etc/dnsmasq.d/01-pihole.conf + + # Restart dnsmasq to load new configuration + RestartDNS + } SetExcludeDomains(){