mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-25 14:20:18 +00:00
fixes #142 kill -HUP erroring on gravity_reload if dnsmasq is not running
This commit is contained in:
parent
8ffa5e9357
commit
89b88a2d5d
1 changed files with 10 additions and 2 deletions
12
gravity.sh
12
gravity.sh
|
@ -243,9 +243,17 @@ function gravity_advanced() {
|
|||
|
||||
function gravity_reload() {
|
||||
# Reload hosts file
|
||||
|
||||
echo "** Refresh lists in dnsmasq..."
|
||||
sudo kill -HUP $(pidof 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
|
||||
}
|
||||
|
||||
gravity_collapse
|
||||
|
|
Loading…
Reference in a new issue