From 83ff0055b672eab6d237b65ea88fe60acc96dbf6 Mon Sep 17 00:00:00 2001 From: Rob Gill Date: Sat, 2 Jun 2018 15:30:51 +1000 Subject: [PATCH] Test and indicate status This added function tests if pihole-FTL is running when the sysV. Signed-off-by: Rob Gill --- advanced/pihole-FTL.service | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/advanced/pihole-FTL.service b/advanced/pihole-FTL.service index ef8ee9c2..ecc7a52a 100644 --- a/advanced/pihole-FTL.service +++ b/advanced/pihole-FTL.service @@ -69,13 +69,25 @@ stop() { echo } +# Indicate the service status +status() { + if is_running; then + echo "[ ok ] pihole-FTL is running" + exit 0 + else + echo "[ ] pihole-FTL is not running" + exit 1 + fi +} + + ### main logic ### case "$1" in stop) stop ;; status) - status pihole-FTL + status ;; start|restart|reload|condrestart) stop