Turn off wifi upon disconnect?

62 views
Skip to first unread message

Bogster

unread,
Feb 5, 2011, 12:02:01 PM2/5/11
to tunnelblick-discuss
I am trying to figure out a way, perhaps by modifying the script used
to monitor the connection, for my MacBook's wifi to turn off when the
VPN connection is lost. Help would be appreciated.
Thanks.

jkbull...gmail.com

unread,
Feb 5, 2011, 12:42:58 PM2/5/11
to tunnelbli...@googlegroups.com
I suggest using the new scripts facility in Tunnelblick 3.2 (beta). You could do it in a "reconnecting.sh" script, and in a "post-disconnect.sh" script. If you don't want it to happen if you purposefully disconnect from the VPN, just do it in  "reconnecting.sh". This avoids modifying any standard scripts, which would be overwritten or might become obsolete when you install a new version of Tunnelblick.

First, create a new Location named "Lost-VPN" that has Airport (and perhaps Ethernet? depends on what you want to do) turned off.

Second, create a .tblk with your configuration, key, and certificate files (see http://code.google.com/p/tunnelblick/wiki/wPkgs#Creation about how to create a .tblk, but add the script files before double-clicking to install it)

Both of the script files should have two lines:
#!/bin/sh -e
scselect Lost-VPN

To get back to your standard networking configuration, change the location back to "Automatic" or whatever else you want. You could do this with the Network System Preferences, or a script like the following:
#!/bin/sh -e
scselect Automatic

Bogster

unread,
Feb 5, 2011, 8:05:33 PM2/5/11
to tunnelblick-discuss
You certainly made that easy. Works great. Thank you!
Reply all
Reply to author
Forward
0 new messages