mirror of
https://github.com/pi-hole/pi-hole
synced 2025-01-02 20:20:56 +00:00
Simplify restarting code for "pihole restartdns". This fixes #2869.
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
1a741f696e
commit
251c9fee98
16
pihole
16
pihole
@ -98,20 +98,16 @@ versionFunc() {
|
|||||||
|
|
||||||
restartDNS() {
|
restartDNS() {
|
||||||
local svcOption svc str output status
|
local svcOption svc str output status
|
||||||
svcOption="${1:-}"
|
svcOption="${1:-restart}"
|
||||||
|
|
||||||
# Determine if we should reload or restart restart
|
# Determine if we should reload or restart
|
||||||
if [[ "${svcOption}" =~ "reload" ]]; then
|
if [[ "${svcOption}" =~ "reload" ]]; then
|
||||||
# Using SIGHUP will NOT re-read any *.conf files
|
# Reload has been requested
|
||||||
|
# Note: This will NOT re-read any *.conf files
|
||||||
svc="killall -s SIGHUP ${resolver}"
|
svc="killall -s SIGHUP ${resolver}"
|
||||||
else
|
else
|
||||||
# Get PID of resolver to determine if it needs to start or restart
|
# A full restart has been requested
|
||||||
if pidof pihole-FTL &> /dev/null; then
|
svc="service ${resolver} restart"
|
||||||
svcOption="restart"
|
|
||||||
else
|
|
||||||
svcOption="start"
|
|
||||||
fi
|
|
||||||
svc="service ${resolver} ${svcOption}"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Print output to Terminal, but not to Web Admin
|
# Print output to Terminal, but not to Web Admin
|
||||||
|
Loading…
Reference in New Issue
Block a user