Skip to content

Instantly share code, notes, and snippets.

@charlesmarshall
Created June 9, 2014 09:49
Show Gist options
  • Save charlesmarshall/4f0bbe145480dec3b2bb to your computer and use it in GitHub Desktop.
Save charlesmarshall/4f0bbe145480dec3b2bb to your computer and use it in GitHub Desktop.
CoreOS etcd sync check
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