IP-Geo-Location Extension Attribute on Jamf Site appears to be broken

gobrien
New Contributor

Hi,
The extension I'm having issue with is the IP Geo Locator - I tried it as a script and don't get anything except the comma, failing that I tested it line by line and get a 404 error from the freegeoip.appspot.com

Do I need to do something special to make this work?

https://www.jamf.com/jamf-nation/third-party-products/files/332/ip-geo-location

Thanks!

3 REPLIES 3

gobrien
New Contributor

FYI, there is a working version on the site, just had to do a little more googling
https://www.jamf.com/jamf-nation/feature-requests/1755/fix-the-ip-geo-location-extension-attribute-template#responseChild8640

plocklin
New Contributor III

This worked for me. (Thanks Zach)

!/bin/sh

myIP=curl -L -s --max-time 10 http://checkip.dyndns.org | egrep -o -m 1 '([[:digit:]]{1,3}.){3}[[:digit:]]{1,3}'
myLocationInfo=curl -L -s --max-time 10 http://ip-api.com/csv/?fields=country,city,lat,lon,/$myIP

echo "<result>$myLocationInfo</result>"

UnPeloton
New Contributor

For clarity...

!#/bin/sh

myIP=curl -L -s --max-time 10 http://checkip.dyndns.org | egrep -o -m 1 '([[:digit:]]{1,3}.){3}[[:digit:]]{1,3}'
myLocationInfo=curl -L -s --max-time 10 http://ip-api.com/csv/?fields=country,city,lat,lon,/$myIP

echo "<result>$myLocationInfo</result>"