|
|
|
@ -105,17 +105,25 @@ restartDNS() {
|
|
|
|
|
svcOption="${1:-restart}"
|
|
|
|
|
|
|
|
|
|
# Determine if we should reload or restart
|
|
|
|
|
if [[ "${svcOption}" =~ "reload" ]]; then
|
|
|
|
|
# Reload has been requested
|
|
|
|
|
if [[ "${svcOption}" =~ "reload-lists" ]]; then
|
|
|
|
|
# Reloading of the lists has been requested
|
|
|
|
|
# Note: This will NOT re-read any *.conf files
|
|
|
|
|
# Note 2: We cannot use killall here as it does
|
|
|
|
|
# not know about real-time signals
|
|
|
|
|
svc="kill -SIGRTMIN $(pidof ${resolver})"
|
|
|
|
|
str="Reloading DNS lists"
|
|
|
|
|
elif [[ "${svcOption}" =~ "reload" ]]; then
|
|
|
|
|
# Reloading of the DNS cache has been requested
|
|
|
|
|
# Note: This will NOT re-read any *.conf files
|
|
|
|
|
svc="killall -s SIGHUP ${resolver}"
|
|
|
|
|
str="Flushing DNS cache"
|
|
|
|
|
else
|
|
|
|
|
# A full restart has been requested
|
|
|
|
|
svc="service ${resolver} restart"
|
|
|
|
|
str="Restarting DNS server"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Print output to Terminal, but not to Web Admin
|
|
|
|
|
str="${svcOption^}ing DNS service"
|
|
|
|
|
[[ -t 1 ]] && echo -ne " ${INFO} ${str}..."
|
|
|
|
|
|
|
|
|
|
output=$( { ${svc}; } 2>&1 )
|
|
|
|
|