From bcef4f0c97637f7d17a94fa8130dda7785ba6264 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 2 Sep 2024 18:59:42 +0200 Subject: [PATCH] pihole status should return (= exit) early on error instead of continuing the script Signed-off-by: DL6ER --- pihole | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pihole b/pihole index f3e0a73a..98f478a3 100755 --- a/pihole +++ b/pihole @@ -346,7 +346,7 @@ statusFunc() { "web") echo "-1";; *) echo -e " ${CROSS} DNS service is NOT running";; esac - return 0 + exit 0 else # get the DNS port pihole-FTL is listening on port="$(getFTLConfigValue dns.port)" @@ -355,7 +355,7 @@ statusFunc() { "web") echo "-1";; *) echo -e " ${CROSS} DNS service is NOT listening";; esac - return 0 + exit 0 else if [[ "${1}" != "web" ]]; then echo -e " ${TICK} FTL is listening on port ${port}" @@ -377,7 +377,8 @@ statusFunc() { *) echo -e " ${CROSS} Pi-hole blocking is disabled";; esac fi -exit 0 + + exit 0 } tailFunc() {