https://danielnovello.github.io/geoWifi/
Lightweight CLI application that scans for available SSID's and if specified SSID is found, trigger a policy in Jamf (Potentailly anything you want to happen)
Note: Does not need to be connected to any Wifi to function. It scans available Wifi SSID's
Manual usage:
sudo ./geoWifi SSID JAMFTRIGGER
If SSID found
Example Alert script in Jamf
#!/bin/bash
/Library/Application\ Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -title "Jamf Security" -windowType hud -description "Jamf Security" -description "You are entering a probibited Area" &
Create a Persistant LaunchDaemon
NOTE: This has not been tested long term. Not sure of the CPU usage over long periods of time.
-
Create a script (make it executable) and copy it your chosen location
#!/bin/bash /PATHTOAPP SSID JAMFTRIGGER
-
Create a LaunchDaemon Plist and copy to /Library/LaunchDaemons (Ammend with the location of your script) Example in Repo Fix the Permissions:
sudo chown root /Library/LaunchDaemons/com.djquazzi.geowifi.plist sudo chgrp wheel /Library/LaunchDaemons/com.djquazzi.geowifi.plist
-
Run the LaunchDaemon
sudo launchctl load -w /Library/LaunchDaemons/com.djquazzi.geowifi.plist
All logs in /private/var/log/geowifi.log You might want to scrub the log every now and again.
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s
The above command using the airport command does work, however testing the airport command and geoWifi along side each other, it is clear that for reliabilty, accuracy and performance geoWifi wins when used with a persistant LaunchDaemon
Built application, example script and launchDaemon in Testing directory