morganestes
7/28/2016 - 9:05 PM

Geolocation for an IP or URL.

Geolocation for an IP or URL.

#!/bin/sh

geoip(){
  ip=$1 || curl https://icanhazip.com
  
  curl "https://freegeoip.net/json/${ip}"
}

geoip "$@"