From c6405bc93be04a248526a1e029281883bae9e253 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Mon, 4 Apr 2016 23:38:46 +0100 Subject: [PATCH] Ensure addn-hosts value is updated in /etc/dnsmasq.d/01-pihole.conf if user has a custom value set in pihole.conf --- gravity.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gravity.sh b/gravity.sh index d741ac80..7d03ae7f 100755 --- a/gravity.sh +++ b/gravity.sh @@ -321,6 +321,12 @@ function gravity_reload() { # Reload hosts file echo ":::" echo -n "::: Refresh lists in dnsmasq..." + + #ensure /etc/dnsmasq.d/01-pihole.conf is pointing at the correct list! + #First escape forward slashes in the path: + adList=${adList//\//\\\/} + #Now replace the line in dnsmasq file + $SUDO sed -i "s/^addn-hosts.*/addn-hosts=$adlist/" /etc/dnsmasq.d/01-pihole.conf dnsmasqPid=$(pidof dnsmasq) find "$piholeDir" -type f -exec $SUDO chmod 666 {} \; & spinner $!