From 3f59b51be19a179d595cf22c1094d44e4a8ed80d Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Thu, 8 Nov 2018 22:00:13 -0500 Subject: [PATCH] Fix restartDNS returning code 1 even when it worked If stdout was not a terminal (the `-t 1` check), `restartDNS` would return code 1 in the success case. This caused the API to fail whenever it tried to restart the DNS server. Signed-off-by: Mcat12 --- pihole | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pihole b/pihole index fb398f29..d4681752 100755 --- a/pihole +++ b/pihole @@ -134,9 +134,11 @@ restartDNS() { if [[ "${status}" -eq 0 ]]; then [[ -t 1 ]] && echo -e "${OVER} ${TICK} ${str}" + return 0 else [[ ! -t 1 ]] && local OVER="" echo -e "${OVER} ${CROSS} ${output}" + return 1 fi }