Created
October 10, 2018 10:15
-
-
Save jpluimers/e29ceec9239851bc2cddd35f5908fc20 to your computer and use it in GitHub Desktop.
Get CSV list of Google IPs used for cloud shell one-liner from https://stackoverflow.com/questions/48308935/google-cloud-shell-does-not-start/48566341?noredirect=1#comment92394955_48566341
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
google_ips=$(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 | xargs | tr " " ",") ; echo IPs: ; echo $google_ips |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment