Created
May 24, 2017 16:20
-
-
Save awaxa/964803df585c517c7776da6238c0d9b3 to your computer and use it in GitHub Desktop.
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
# vi: filetype=sh | |
ipinfo () { | |
ip="$1" | |
curl="curl --silent https://ipinfo.io/$ip" | |
command -v pbcopy >/dev/null \ | |
&& printf %s "$curl" | pbcopy | |
if command -v jq >/dev/null ; then | |
$curl | jq . | |
else | |
$curl | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment