Created
June 6, 2016 20:01
-
-
Save simplyvikram/8943a72a84a5e03d70429c183297e065 to your computer and use it in GitHub Desktop.
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 | |
# https://cloud.google.com/compute/docs/faq#ipranges | |
#nslookup -q=TXT _cloud-netblocks.googleusercontent.com 8.8.8.8 | |
for LINE in `dig txt _cloud-netblocks.googleusercontent.com +short | tr " " "\n" | grep include | cut -f 2 -d :` | |
do | |
dig txt $LINE +short | |
done | tr " " "\n" | grep ip4 | cut -f 2 -d : | sort -n | tr '\n' ',' | sed 's/,$//g' | |
# adapted from https://gist.github.com/n0531m/f3714f6ad6ef738a3b0a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment