Created
April 9, 2013 17:19
-
-
Save bitboss-ca/5347560 to your computer and use it in GitHub Desktop.
A handy way to get your public IP address from a command line. This has been tested on Mac and FreeBSD.
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/sh | |
curl -s https://www.google.ca/search\?q\=whats+my+ip | awk '{print substr($0,index($0,"Client IP address"),34)}' | cut -d ')' -f 1 | head -n1 | sed 's/Client/Public/' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment