Created
August 25, 2015 18:29
-
-
Save DennisLfromGA/ab40940d37be84ae3a88 to your computer and use it in GitHub Desktop.
Script to grab your WAN IP address using various means.
This file contains hidden or 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
#!/usr/bin/env sh | |
ipurl="icanhazip.com" | |
if hash dig 2>/dev/null; then cmd="dig +short myip.opendns.com @resolver1.opendns.com"; ipurl="" | |
elif hash curl 2>/dev/null; then cmd="curl" | |
elif hash wget 2>/dev/null; then cmd="wget -qO-" | |
else echo "*** No app (dig,curl,wget) found - exiting ***"; exit 2; fi | |
[ -n "$1" ] && echo -n "$cmd $ipurl - " | |
eval $cmd $ipurl || ret=$? | |
exit $ret |
None, I can make it private if it's an issue, just lemme know.
I have other public scripts that maybe should also be made private.
It's not an issue at all! I just wanted to know because chromebrew packages it, and we're updating our packages with a license field. Unlicensed software is all rights reserved, so I just wanted to make sure it was that.
Whew!
Anyone is welcome to use my public stuff so please go ahead if you like.
I most likely grabbed this from someone else's unlicensed script but that's what's great about Linux.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@DennisLfromGA what license is this script under?