Last active
March 25, 2016 05:07
-
-
Save stahnma/62b69c37ab146501dbb0 to your computer and use it in GitHub Desktop.
Consul Leader
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
#!/bin/bash | |
ans=`curl -s http://localhost:8500/v1/status/leader` | |
if [ "$?" = "0" ] ; then | |
ip=$(echo $ans | cut -d: -f1 | sed -e 's/"//g') | |
consul members | grep $ip | awk '{print $1}' | |
fi | |
exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment