keepalived: check_containner.sh

File check_containner.sh, 306 bytes (added by krit, 2 years ago)
Line 
1container_name=node2
2if [ "$( docker container inspect -f '{{.State.Status}}' $container_name )" == "running" ]; then
3   echo "$container_name is running"
4else
5   echo "$container_name is not running, we will start again"
6   /usr/bin/docker start $container_name
7   echo "start $container_name Done!!"
8fi