Created
April 8, 2016 22:57
-
-
Save jbuck/50018d9a1fef3916ced568391f280515 to your computer and use it in GitHub Desktop.
Watch for ELB scaling via DNS record changes
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 | |
DOMAIN="$1" | |
OLD_RECORDS="`dig +short @8.8.8.8 $DOMAIN A | sort`" | |
echo `date` $OLD_RECORDS | |
while true; do | |
sleep 30 | |
NEW_RECORDS="`dig +short @8.8.8.8 $DOMAIN A | sort`" | |
if [ "$OLD_RECORDS" != "$NEW_RECORDS" ]; then | |
echo `date` $NEW_RECORDS | |
OLD_RECORDS="`dig +short @8.8.8.8 $DOMAIN A | sort`" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment