Mac OS X: Turn off WiFi/Ethernet if connection to OVPN is lost
By default, our client configuration for Tunnelblick contains a script that automatically shuts down uTorrent and BitTorrent if you are ever disconnected from OVPN.
The script also contains the possibility to turn off WiFi and Ethernet. To activate this functionality, do the following steps:
- Download a configuration file for Mac OS X.
- Extract the content from the .zip file.
- Right-click on the .tblk file that was extracted in Step 2.
- Choose ’Show package content’.
- Open reconnecting.sh with a text editor.
- Find the lines containing:
- Place a # before all of them so that it looks like this:
♯ ifconfig en1 down
♯ ifconfig en0 down
- Remove the # sign in front of the line to get this following result:
ifconfig en1 down
ifconfig en0 down
- If your OVPN connection is lost at any point, you will need to manually activate the WiFi and Ethernet to make it work again. You do this by entering the following in the terminal.
sudo ifconfig en1 up
sudo ifconfig en0 up