Update dnsmasq config

This commit is contained in:
Bob Mottram 2016-10-30 12:32:49 +00:00
parent fae5804c82
commit 2cf05ecaf4
1 changed files with 5 additions and 2 deletions

View File

@ -106,9 +106,12 @@ function pihole_update {
echo 'listen-address=127.0.0.1' >> /etc/dnsmasq.conf echo 'listen-address=127.0.0.1' >> /etc/dnsmasq.conf
echo 'log-queries' >> /etc/dnsmasq.conf echo 'log-queries' >> /etc/dnsmasq.conf
sed -i "0,/RE/s/server=.*/server=${PIHOLE_DNS1}/" /etc/dnsmasq.d/01-pihole.conf sed -i "s|@DNS1@|${PIHOLE_DNS1}|g" /etc/dnsmasq.d/01-pihole.conf
sed -i "1,/RE/s/server=.*/server=${PIHOLE_DNS2}/" /etc/dnsmasq.d/01-pihole.conf sed -i "s|@DNS2@|${PIHOLE_DNS2}|g" /etc/dnsmasq.d/01-pihole.conf
sed -i "s|interface=.*|interface=${PIHOLE_IFACE}|g" /etc/dnsmasq.d/01-pihole.conf sed -i "s|interface=.*|interface=${PIHOLE_IFACE}|g" /etc/dnsmasq.d/01-pihole.conf
sed -i "s|@IPv4@|${IPv4_address}|g" /etc/dnsmasq.d/01-pihole.conf
sed -i "s|@IPv6@|${IPv6_address}|g" /etc/dnsmasq.d/01-pihole.conf
sed -i "s|@HOSTNAME@|$HOSTNAME|g" /etc/dnsmasq.d/01-pihole.conf
systemctl restart dnsmasq systemctl restart dnsmasq