|
|
Update Location on Wake
After combining several of the hints here, this is what I finally got working for me:
First, I installed SleepWatcher so that I can trigger the script when I wake from sleep. Given how I work, that's enough for me.
Then I created /usr/local/bin/update-location.sh:
Then in ~/.wakeup
All this does is call the above script when the computer wakes. This way, you can easily add other tasks while keeping the location-switching code separate.
I wanted the list of locations to be easily editable, so I created a tab-delimited file at ~/.wlans
It's just a list of wireless network - location pairs separated by a tab. If the update-locations.sh script doesn't find an entry, it will default back to Automatic.
This works for me, ymmv. Like I said, this is mainly a conglomeration of other hints, but I thought I'd pass it on for posterity.
Update Location on Wake
I found I had to make the following change in the script (see below) in order for it to work for me. It is an excellent script, now I don't ever have to remember to change locations. The one other element to the script that I would like to add is for it to change locations based on ip address (i.e. have it check for a wired ethernet ip address and set the location depending on the ip address it is currently getting, if it doesn't find a wired ip address to fall back to the current script to check for a wireless network and set the location accordingly. Thanks for the script Colter Here's the original code
Here's what I had to change it to get it to work for me.
|
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.08 seconds |
|