From 251c9fee98b853ed7caef205f4cffcd50845423c Mon Sep 17 00:00:00 2001 From: DL6ER Date: Wed, 14 Aug 2019 20:58:18 +0200 Subject: [PATCH] Simplify restarting code for "pihole restartdns". This fixes #2869. Signed-off-by: DL6ER --- pihole | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/pihole b/pihole index 84a5623f..90309eee 100755 --- a/pihole +++ b/pihole @@ -98,20 +98,16 @@ versionFunc() { restartDNS() { 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 - # 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}" else - # Get PID of resolver to determine if it needs to start or restart - if pidof pihole-FTL &> /dev/null; then - svcOption="restart" - else - svcOption="start" - fi - svc="service ${resolver} ${svcOption}" + # A full restart has been requested + svc="service ${resolver} restart" fi # Print output to Terminal, but not to Web Admin