Skip to content

Instantly share code, notes, and snippets.

@lance
Created May 29, 2012 12:08
Show Gist options
  • Save lance/2828087 to your computer and use it in GitHub Desktop.
Save lance/2828087 to your computer and use it in GitHub Desktop.
Toggle VPN
tell application "System Events"
tell current location of network preferences
set VPNservice to service "NAME OF YOUR VPN"
if exists VPNservice then set isConnected to connected of current configuration of VPNservice
if isConnected is false then
connect VPNservice
else
disconnect VPNservice
end if
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment