How to start Tunnelblick VPN connection via Terminal
I can connect/disconnect using the Tunnelblick app. How do I connect via the command line?
/Applications/Tunnelblick.app/Contents/Resources/openvpnstart start ???
How do I determine the parameters to pass?
A possibly better idea than messing around with openvpn directly (Tunnelblick is basically just a fancy GUI around it) would be to use an Applescript, something that can definitely be launched from the terminal (i.e. with osascript
)
Example taken from here:
tell application "Tunnelblick"
connect "Company_VPN"
get state of first configuration where name = "Company_VPN"
repeat until result = "CONNECTED"
delay 1
get state of first configuration where name = "Company_VPN"
end repeat
end tell
You'd write this into the Script Editor, save it, and then you could launch it from the terminal with osascript
, or by double clicking on the script.