Skip to content

Instantly share code, notes, and snippets.

@ntmggr
Created December 30, 2015 09:33
Show Gist options
  • Save ntmggr/3b363e4c2c2545d2d56a to your computer and use it in GitHub Desktop.
Save ntmggr/3b363e4c2c2545d2d56a to your computer and use it in GitHub Desktop.
Run Tunnelblick from MacOS cli

TunnelBlick from MacOS cli

Create the the OSA script and save it with .scpt extension

tell application "Tunnelblick"
    connect "Your_existing_Tunneblick_vpn_name"
    get state of first configuration where name = "Your_existing_Tunneblick_vpn_name"
    repeat until result = "CONNECTED"
        delay 1
        get state of first configuration where name = "Your_existing_Tunneblick_vpn_name"
    end repeat
end tell

Run the script using OSA

osascript mytunnelblick.scpt &

Test that you can access your VPN network

ping host in vpn network

Debug

check /var/log/system.log for details

@yugu91
Copy link

yugu91 commented Jan 9, 2018

thank you so much for your code.
and than.
how to run disconnect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment