mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-28 17:13:17 +00:00
Changed dnsmasq restart handling to be the same as gravity.sh
This commit is contained in:
parent
4b1dd8a2a5
commit
f964aff9b0
1 changed files with 12 additions and 2 deletions
|
@ -52,6 +52,16 @@ if [[ "$combopattern" != "" ]]; then
|
||||||
sed -r -i '/'"$pattern"'/d' $adList
|
sed -r -i '/'"$pattern"'/d' $adList
|
||||||
|
|
||||||
echo "** $# domain(s) whitelisted."
|
echo "** $# domain(s) whitelisted."
|
||||||
# Force dnsmasq to reload /etc/pihole/gravity.list
|
# Reload hosts file
|
||||||
kill -HUP $(pidof dnsmasq)
|
echo "** Refresh lists in dnsmasq..."
|
||||||
|
|
||||||
|
dnsmasqPid=$(pidof dnsmasq)
|
||||||
|
|
||||||
|
if [[ $dnsmasqPid ]]; then
|
||||||
|
# service already running - reload config
|
||||||
|
sudo kill -HUP $dnsmasqPid
|
||||||
|
else
|
||||||
|
# service not running, start it up
|
||||||
|
sudo service dnsmasq start
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue