From 3ec84553ef1dd50d057839205d0f3960c52d680b Mon Sep 17 00:00:00 2001 From: bcambl Date: Wed, 24 Oct 2018 10:06:11 -0600 Subject: [PATCH] fix debug service check via sysvinit Signed-off-by: bcambl --- advanced/Scripts/piholeDebug.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index 022265fd..384c708b 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -836,9 +836,13 @@ process_status(){ local status_of_process status_of_process=$(systemctl is-active "${i}") else - # Otherwise, use the service command + # Otherwise, use the service command and mock the output of `systemctl is-active` local status_of_process - status_of_process=$(service "${i}" status | awk '/Active:/ {print $2}') &> /dev/null + if service "${i}" status | grep -E 'is\srunning' &> /dev/null; then + status_of_process="active" + else + status_of_process="inactive" + fi fi # and print it out to the user if [[ "${status_of_process}" == "active" ]]; then