Created
June 16, 2017 15:07
-
-
Save krasnuydyx/8e73196dd1b2aa71462b6e39b01c62d6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
function status { | |
docker inspect $1 | grep Status | awk '{print $2}' | |
} | |
cont="nginx-srv registry-web registry-srv" | |
get_regex="^.*running.*$" | |
for i in $cont | |
do | |
get_status=$(status ${i}) | |
if [[ $get_status =~ $get_regex ]]; then | |
echo "Container ${i} is running" | |
else | |
echo "Container ${i} is not running, restarting" | |
/root/registry/run-registry.sh | |
exit 0 | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment