Skip to content

Instantly share code, notes, and snippets.

@jsonmaur
Created October 21, 2016 05:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsonmaur/f1b19c0adcd9c1c8ddf282b4604bf699 to your computer and use it in GitHub Desktop.
Save jsonmaur/f1b19c0adcd9c1c8ddf282b4604bf699 to your computer and use it in GitHub Desktop.
cli53 round robin
HOST_NAME="speed"
TTL="300"
CURRENT_IPS=($(cli53 export -f "cdn.test.com" | grep "speed.cdn.test.com" | awk '{print $5}'));
for i in "${CURRENT_IPS[@]}"; do if [ $i != $PUBLIC_IP ]; then echo $i && IPCMD+=("$HOST_NAME $TTL A $i"); fi done
/usr/local/bin/cli53 rrcreate --replace "cdn.test.com" "${IPCMD[@]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment