philippe::niquille | regular niche market thoughts

location dependent VPN auto-connect (v2)

May 21st 2007
2 Comments
respond
trackback

I changed a couple of things since the last script bundle:

  • The keychain is used for password storage. Add an item to your login keychain called vpn with your password. The username stays hardcoded. Click “Always allow” the first time you execute the script.
  • It now logs to system.log
  • Reduced to one .py file. The whole kextload and -unload didn’t work without root permission.

The only serious problem I experienced with this file is a problem caused by Kicker.xml. The script does get called but no matter what user-id (0 for root or 501 for my user) I use, the VPN command doesn’t work. It may have something to do with the Security Context?

Two notes have to be mentioned:
1) For your Kicker.xml changes to take effect you either need to restart configd or reboot the system. Unfortunately my OS X chrashed after restarting configd manually?! See this page.

Lena:~/bin root# killall configd
Lena:~/bin root# configd
Lena:~/bin root# ps ax | grep configd
5209 ?? Ss 0:00.96 config

2) Debugging: check /var/log/system.log - you should see something like the following when you change your network state:

May 15 17:24:47 Lena kernel[0]: AppleYukon - en0 link active, 100-Mbit, full duplex, symmetric flow control enabled
May 15 17:24:48 Lena configd[37]: executing /Users/fluppel/scripts/autovpn.py
May 15 17:24:48 Lena configd[37]: posting notification com.apple.system.config.network_change
May 15 17:24:48 Lena configd[37]: setting hostname to “hsgpublicnet304″
May 15 17:24:49 Lena lookupd[854]: lookupd (version 369.6) starting - Tue May 15 17:24:49 2007
May 15 17:24:50 Lena mDNSResponder: Repeated transitions for interface en0 (130.82.114.123); delaying packets by 5 seconds
May 15 17:24:52 Lena root[870]: auto-initiating VPN..

2 Comments

  1. Hello from Hawaii. My name is Christopher and I am 11 years old. I have a school project due about Switzerland, Friday!!. I need interview someone from Switzerland. I hope you can help me. I am also learning PHP. See my site.

    Questions:

    1. Where do you live in Switzerland?

    2. Are the Alps mountains beautiful?

    3. What is your favorite Swiss food, and what is the recipe?

    4. What do you do for fun in Switzerland?

    5. What’s your main language?

    Email me, webmaster AT misterchrister DOT com.

    Thanks, Misterchrister Team

  2. Antonio

    Phillipe, you might find this piece of software somewhat interesting.

    http://www.nexumoja.org/projects/Shimo/

Incoming Links

Leave a Reply