How to reconnect VPN by using Tunnelblick from command line?

44 views
Skip to first unread message

Qi Luk

unread,
Jan 16, 2017, 2:52:42 PM1/16/17
to tunnelblick-discuss
The use case is that I need a particular VPN connected at all times on one of my servers which runs macOS. It's set up with Tunnelblick. And I know how to re-connect to it manually using Tunnelblick GUI. But I noticed that sometimes due to network sometimes disconnecting due to instability or some such, Tunnelblick could get into a state of repeatedly trying to reconnect to the previously connected VPN but would never succeed. Therefore, I'm hoping I can create a cron job to periodically check if the VPN is connected (probably by pinging an URL only accessible via the said VPN), and if not, reconnect to it by restarting Tunnelblick and reconnect to the VPN. What should the command line be? I intend to add the command line into my crontab.

(I asked the question at http://apple.stackexchange.com/questions/269073/how-to-reconnect-vpn-by-using-tunnelblick-from-command-line, but to get a better chance of getting an answer, I'm asking here as well.)

Tunnelblick developer

unread,
Jan 16, 2017, 3:01:03 PM1/16/17
to tunnelblick-discuss
Take a look at AppleScript Support for ideas on how to script what you want.

However, if Tunnelblick is repeatedly trying and failing to connect (actually, OpenVPN is probably doing that, not Tunnelblick), you probably have a problem in your configuration. Please follow the instructions at Read Before You Post to get the info needed to diagnose problems and then post that info.
Reply all
Reply to author
Forward
0 new messages