mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-11-22 20:51:07 +01:00
Implemented excited check
This commit is contained in:
parent
7db4a5a42f
commit
8150de75da
@ -1,10 +1,20 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
docker_ps_grep_unhealthy="$(docker ps | grep unhealthy)"
|
docker_ps_grep_unhealthy="$(docker ps | grep unhealthy)"
|
||||||
if [ -z "$docker_ps_grep_unhealthy" ]
|
docker_ps_grep_exited="$(docker ps -a | grep Exited)"
|
||||||
|
exitcode=0
|
||||||
|
if [ ! -z "$docker_ps_grep_unhealthy" ]
|
||||||
then
|
then
|
||||||
|
echo "Some docker containers are unhealthy: $docker_ps_grep_unhealthy"
|
||||||
|
exitcode=1
|
||||||
|
fi
|
||||||
|
if [ ! -z "$docker_ps_grep_exited" ]
|
||||||
|
then
|
||||||
|
echo "Some docker containers exited: $docker_ps_grep_exited"
|
||||||
|
exitcode=2
|
||||||
|
fi
|
||||||
|
if [ "$exitcode" -ne "0" ]
|
||||||
|
then
|
||||||
|
exit $exitcode
|
||||||
|
fi
|
||||||
echo "All docker containers are healthy."
|
echo "All docker containers are healthy."
|
||||||
exit
|
exit
|
||||||
else
|
|
||||||
echo "Some docker containers are unhealthy: $docker_ps_grep_unhealthy"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
Loading…
Reference in New Issue
Block a user