Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Change location automatically based on network' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Change location automatically based on network
Authored by: bjmorgan on Jan 18, '05 12:11:16PM

I wonder... would this work with my network at home that doesn't broadcast an SSID? In fact, neither of the networks I regularly switch to broadcast.



[ Reply to This | # ]
Change location automatically based on network
Authored by: AJB on Jan 18, '05 03:06:41PM
I've been doing something like this for a long time without using a broadcast SSID. try:
ATTACHEDWLAN=`/usr/sbin/system_profiler SPAirPortDataType|awk -F": " '/Current Wireless Network/{print $2}'`
I also test for "AirPort is currently turned off" | "wireless network not available" and then check the ethernet LAN IP as a fallback
ETHERNETIP=`/sbin/ifconfig en0 | grep netmask | awk '{print $2}'`
to put the icing on all this, I run it in a script on wake up, setting location to automatic if it fails to determine where I am, and back off with an exponential delay before repeating.

[ Reply to This | # ]
Change location automatically based on network
Authored by: bear8b on Jan 18, '05 05:52:47PM

How do you run a script on wake up? I have been looking for that trick!



[ Reply to This | # ]
Change location automatically based on network
Authored by: miggins on Jan 18, '05 08:55:20PM
You need SleepWatcher from http://www.bernhard-baehr.de/, it lets you run scripts on sleep and wake events.

[ Reply to This | # ]
Change location automatically based on network
Authored by: richwiss on Jan 18, '05 10:11:07PM

The other option is to simply list each of the SSID's at your work in this script and if it auto-connects to the wrong one, have the script set your Location to "Work" (or "Home" as the case may be) and the Location will then change you over to the correct SSID.



[ Reply to This | # ]