mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 10:43:55 +00:00
Correctly identify process status in debug script on docker
Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
parent
a8b6eb9b70
commit
7536c312ee
1 changed files with 14 additions and 3 deletions
|
@ -925,10 +925,21 @@ process_status(){
|
||||||
else
|
else
|
||||||
# Otherwise, use the service command and mock the output of `systemctl is-active`
|
# Otherwise, use the service command and mock the output of `systemctl is-active`
|
||||||
local status_of_process
|
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
|
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
|
||||||
fi
|
fi
|
||||||
# and print it out to the user
|
# and print it out to the user
|
||||||
|
|
Loading…
Reference in a new issue