Created
February 7, 2019 07:02
-
-
Save Inquizarus/5c0ea028ae14a60fec7cc67e731c9d51 to your computer and use it in GitHub Desktop.
Script for getting etcd client ip's
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 | |
echo $(curl --silent "https://discovery.etcd.io/$1" | \ | |
jq '.node.nodes | map(.value)' | \ | |
grep -oE '([[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\:[[:digit:]]{4})' | \ | |
sed -e 's/2380/2379/g; 1!s/^/,/g') | \ | |
sed -e 's/\(\s\)//g' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment