Update dnsmasq file when changing upstream DNS servers and restart the service to get it active

This commit is contained in:
DL6ER 2016-12-12 14:16:13 +01:00
parent d4f83cb1d4
commit 2f4b7ce3dd

View file

@ -65,6 +65,14 @@ SetDNSServers(){
echo "PIHOLE_DNS_1=${args[2]}" >> /etc/pihole/setupVars.conf echo "PIHOLE_DNS_1=${args[2]}" >> /etc/pihole/setupVars.conf
echo "PIHOLE_DNS_2=${args[3]}" >> /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(){ SetExcludeDomains(){