Skip to content

Instantly share code, notes, and snippets.

@stvhwrd
Created February 22, 2017 03:48
Show Gist options
  • Save stvhwrd/da1f992d9d6f96aa0a21c56a8ab9f943 to your computer and use it in GitHub Desktop.
Save stvhwrd/da1f992d9d6f96aa0a21c56a8ab9f943 to your computer and use it in GitHub Desktop.
Connect to / disconnect from VPN server via Tunnelblick on the macOS command line
# Connect to VPN configuration, usage: vpn_connect "US Seattle";
vpn_connect() {
osascript -e "tell application \"Tunnelblick\"" -e "connect \"$1\"" -e "end tell"
}
# Disconnect from all Tunnelblick connections, usage: vpn_disconnect;
vpn_disconnect() {
osascript -e "tell application \"Tunnelblick\"" -e "disconnect all" -e "end tell" ⏎
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment