Skip to content

Instantly share code, notes, and snippets.

@Inquizarus
Created February 7, 2019 07:02
Show Gist options
  • Save Inquizarus/5c0ea028ae14a60fec7cc67e731c9d51 to your computer and use it in GitHub Desktop.
Save Inquizarus/5c0ea028ae14a60fec7cc67e731c9d51 to your computer and use it in GitHub Desktop.
Script for getting etcd client ip's
#!/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