mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
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 <newtoncat12@yahoo.com>
This commit is contained in:
parent
51218bd1ad
commit
3f59b51be1
1 changed files with 2 additions and 0 deletions
2
pihole
2
pihole
|
@ -134,9 +134,11 @@ restartDNS() {
|
||||||
|
|
||||||
if [[ "${status}" -eq 0 ]]; then
|
if [[ "${status}" -eq 0 ]]; then
|
||||||
[[ -t 1 ]] && echo -e "${OVER} ${TICK} ${str}"
|
[[ -t 1 ]] && echo -e "${OVER} ${TICK} ${str}"
|
||||||
|
return 0
|
||||||
else
|
else
|
||||||
[[ ! -t 1 ]] && local OVER=""
|
[[ ! -t 1 ]] && local OVER=""
|
||||||
echo -e "${OVER} ${CROSS} ${output}"
|
echo -e "${OVER} ${CROSS} ${output}"
|
||||||
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue