Last active
February 14, 2024 17:15
-
-
Save colehocking/40cae24330067aa6440ca817b08119b7 to your computer and use it in GitHub Desktop.
Open Google Maps for an IP address
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
| #!/bin/bash | |
| # Open Google Maps for an IP address; | |
| # requires jq | |
| # Replace "firefox" with "open" for OSX | |
| # requires osescript for the "open" command. | |
| IP=$1 | |
| COOR=$(curl -s http://ipinfo.io/${IP} | jq .loc) | |
| MAP="https://maps.google.com/maps?q=${COOR}" | |
| echo "Opening map for: ${IP}" | |
| echo "Coordinates: ${COOR}" | |
| firefox "${MAP}" 2>/dev/null & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment