Does anyone know how to automatically mount a network share once a VPN connection using Tunnelblick has connected?
Right now I have to connect and then do a cmd+K in the finder to connect to the AFP share. It'd be nice if it would connect automatically.
The share doesn't have a password (TimeCapsule without any passwords, and no, not using it for backup, we use it for a fileserver).
Best Answer
1.
Edit the file
/Applications/Tunnelblick.app/Contents/Resources/client.up.osx.sh
and add these commands at the end of the file, just beforeexit 0
:Replace USERNAME with your username on the system.
2.
Then add the following at the end of
/Applications/Tunnelblick.app/Contents/Resources/client.down.osx.sh
:3.
Do not forget to check the
set nameserver
option for your configuration :Warning : Configuration files
client.(up|down).osx.sh
are executed for every connections made using OpenVPN.This could also be made using
launchd
for watching if the vpn connection is up, but I don't know how to use launchd.