Created
June 9, 2014 09:49
-
-
Save charlesmarshall/4f0bbe145480dec3b2bb to your computer and use it in GitHub Desktop.
CoreOS etcd sync check
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
etcd_sync_check(){ | |
count=0; | |
while ( true ); do | |
check=$(etcdctl ls / | grep 'Cannot sync' | wc -l) ; | |
if [ $check -eq 0 ]; then | |
break ; | |
else | |
warning "Cannot connect to etcd" | |
if [ $count -gt 50 ]; then | |
fatal "Failed to connect to etcd" | |
fi | |
fi ; | |
sleep 10 ; | |
done ; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment