Automatically change network locations with a cron job

Nov 13, '03 10:22:00AM

Contributed by: Hes Nikke

I've gotten tired of having to change my location every time I open my notebook at home or at school/work. So I have adjusted my crontab as follows:


 0      8       *       *       1,2,3,4,5       scselect School
 40     14      *       *       1,2,3,4,5       scselect Home
Translated, I have it change my network location to School every weekday at 8 AM (the time I'm scheduled to be at school) and back to my Home location when I'm expecting to be home from school.

The only catch is that I don't think this will execute when my computer is asleep (unless this changed with Panther), so I used Fink to install anacron which executes cron commands as soon after their scheduled times as possible, rather then right at the scheduled time.

Comments (8)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20031105133931182