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