Skip to main content
Question

Find the current location of user via scripting

  • September 16, 2021
  • 1 reply
  • 13 views

Forum|alt.badge.img+6

Hi,

 

We are looking to group users by the geo location when deploying nessus so our Security team have an idea what geolocation is user located in.

 

For a snippet i am trying where using date +%Z command, I grab the time zone and then assign the EDT to a variable if user is in EDT but when there is a change, I have to account for EST as well. This would mean bunch of variables containing bunch of timezones for all geolocations for grouping.

 

Another method was to use sudo fdesetup -gettimezone  and do a cross check of user is in America/ New York, assign to US group etc.

 

I want ask if anyone knows a builtin mechanism which just grabs the country of the geolocation that I can cross check against. I would like to avoid installing things like whereami etc on our machines

 

Thank you.

1 reply

talkingmoose
Forum|alt.badge.img+36
  • Community Manager
  • September 16, 2021