diff options
author | Christian König <ckoenig@posteo.de> | 2022-11-13 23:53:59 +0300 |
---|---|---|
committer | Christian König <ckoenig@posteo.de> | 2022-11-13 23:53:59 +0300 |
commit | 7536c312ee7148734a520254f30c01050d04b416 (patch) | |
tree | 859d976661cbbc8d1ff6c4442d4d7de87a1dc9d2 | |
parent | a8b6eb9b7007e7d51d5923342bf6165874071e34 (diff) |
Correctly identify process status in debug script on dockerdebug_docker_s6
Signed-off-by: Christian König <ckoenig@posteo.de>
-rwxr-xr-x | advanced/Scripts/piholeDebug.sh | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index 99ab6cbe..7ad92412 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -925,10 +925,21 @@ process_status(){ else # Otherwise, use the service command and mock the output of `systemctl is-active` local status_of_process - if service "${i}" status | grep -E 'is\srunning' &> /dev/null; then - status_of_process="active" + + # If DOCKER_VERSION is set, the output is slightly different (s6 init system on Docker) + if [ -n "${DOCKER_VERSION}" ]; then + if service "${i}" status | grep -E '^up' &> /dev/null; then + status_of_process="active" + else + status_of_process="inactive" + fi else - status_of_process="inactive" + # non-Docker system + if service "${i}" status | grep -E 'is\srunning' &> /dev/null; then + status_of_process="active" + else + status_of_process="inactive" + fi fi fi # and print it out to the user |