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


Click here to return to the 'Automatically set location based on connected SSID' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Automatically set location based on connected SSID
Authored by: smkolins on Feb 24, '06 06:01:09AM

Anyone have experience with this kind of thing in light of closed networks and even Cisco LEAP authentication complications added to the mix?

I mean I have locations that if you switch to will connect to all these networks (mixed closed, and or LEAPed) and will such a script succeed in this case?

I also agree that everyone's suggestion on patches to the script would be nice as a finished product.

From reading all the subthreads it *looks* like, this might serve?

set AirportName to do shell script ¬
airport -I | awk '/ SSID/ {print $2}'

set CurrentLocation to "Automatic"
if AirportName is "Home" then set CurrentLocation to "Home"
if AirportName is "Work1" then set CurrentLocation to "My work"
if AirportName is "Work2" then set CurrentLocation to "Other Office"

say "I think I am at location " & CurrentLocation & ", I will adjust my network settings accordingly"

do shell script "/usr/sbin/scselect '" & CurrentLocation & "'"end tell

if AirportName is "Work1" then mount volume "smb://server/share"
if AirportName is "Home" then mount volume "smb://administrator@mycomputer/share"

Aside from that I have some 30 locations so detailing such a script seems a pretyt big job.... Would something read through the locations actually defined if something in the name related to the network you joined?

Finally there are those occasions when you join a wired network instead....

---
Possess a pure, kindly, and radiant heart!



[ Reply to This | # ]