computer-playbook/roles/native-docker-health-check/files/docker-health-check.sh

10 lines
255 B
Bash

#!/bin/sh
docker_ps_grep_unhealthy="$(docker ps | grep unhealthy)"
if [ -z "$docker_ps_grep_unhealthy" ]
then
echo "All docker containers are healthy."
exit
else
echo "Some docker containers are unhealthy: $docker_ps_grep_unhealthy"
exit 1
fi