Skip to content

Instantly share code, notes, and snippets.

@awaxa
Created May 24, 2017 16:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save awaxa/964803df585c517c7776da6238c0d9b3 to your computer and use it in GitHub Desktop.
Save awaxa/964803df585c517c7776da6238c0d9b3 to your computer and use it in GitHub Desktop.
# 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