Skip to content

Instantly share code, notes, and snippets.

@pratikbin
Created October 18, 2022 01:37
Show Gist options
  • Save pratikbin/a8e83d46c45a894513884d9f2c542903 to your computer and use it in GitHub Desktop.
Save pratikbin/a8e83d46c45a894513884d9f2c542903 to your computer and use it in GitHub Desktop.
#
# Usage: ./get_ip_info.sh address.json
#
# set -x
export IFS=$'\n'
for ip in $(jq -r '.addrs[].addr.ip' $1); do
curl -sLfk ipinfo.io/$ip | jq -r '. | "\(.city) | \(.region) | \(.country)"'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment