mirror of
https://github.com/pi-hole/pi-hole
synced 2025-01-05 13:40:56 +00:00
use finction in pihole to restart dnsmasq
This commit is contained in:
parent
60873144ea
commit
dda448e050
18
gravity.sh
18
gravity.sh
@ -322,23 +322,7 @@ gravity_reload() {
|
|||||||
# sed -i "s/^addn-hosts.*/addn-hosts=$adList/" /etc/dnsmasq.d/01-pihole.conf
|
# sed -i "s/^addn-hosts.*/addn-hosts=$adList/" /etc/dnsmasq.d/01-pihole.conf
|
||||||
find "$piholeDir" -type f -exec chmod 666 {} \;
|
find "$piholeDir" -type f -exec chmod 666 {} \;
|
||||||
|
|
||||||
dnsmasqPid=$(pidof dnsmasq)
|
pihole restartdnsmasq
|
||||||
|
|
||||||
if [[ ${dnsmasqPid} ]]; then
|
|
||||||
# service already running - reload config
|
|
||||||
if [ -x "$(command -v systemctl)" ]; then
|
|
||||||
systemctl restart dnsmasq
|
|
||||||
else
|
|
||||||
service dnsmasq restart
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
# service not running, start it up
|
|
||||||
if [ -x "$(command -v systemctl)" ]; then
|
|
||||||
systemctl start dnsmasq
|
|
||||||
else
|
|
||||||
service dnsmasq start
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for var in "$@"
|
for var in "$@"
|
||||||
|
Loading…
Reference in New Issue
Block a user