mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 10:43:55 +00:00
Merge pull request #3036 from pi-hole/fix/reload-lists
Improve list reloading
This commit is contained in:
commit
0b0ec43bf5
2 changed files with 12 additions and 4 deletions
|
@ -257,5 +257,5 @@ echo "DONE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${reload}" != false ]]; then
|
if [[ "${reload}" != false ]]; then
|
||||||
pihole restartdns reload
|
pihole restartdns reload-lists
|
||||||
fi
|
fi
|
||||||
|
|
14
pihole
14
pihole
|
@ -105,17 +105,25 @@ restartDNS() {
|
||||||
svcOption="${1:-restart}"
|
svcOption="${1:-restart}"
|
||||||
|
|
||||||
# Determine if we should reload or restart
|
# Determine if we should reload or restart
|
||||||
if [[ "${svcOption}" =~ "reload" ]]; then
|
if [[ "${svcOption}" =~ "reload-lists" ]]; then
|
||||||
# Reload has been requested
|
# 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
|
# Note: This will NOT re-read any *.conf files
|
||||||
svc="killall -s SIGHUP ${resolver}"
|
svc="killall -s SIGHUP ${resolver}"
|
||||||
|
str="Flushing DNS cache"
|
||||||
else
|
else
|
||||||
# A full restart has been requested
|
# A full restart has been requested
|
||||||
svc="service ${resolver} restart"
|
svc="service ${resolver} restart"
|
||||||
|
str="Restarting DNS server"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Print output to Terminal, but not to Web Admin
|
# Print output to Terminal, but not to Web Admin
|
||||||
str="${svcOption^}ing DNS service"
|
|
||||||
[[ -t 1 ]] && echo -ne " ${INFO} ${str}..."
|
[[ -t 1 ]] && echo -ne " ${INFO} ${str}..."
|
||||||
|
|
||||||
output=$( { ${svc}; } 2>&1 )
|
output=$( { ${svc}; } 2>&1 )
|
||||||
|
|
Loading…
Reference in a new issue