Created
May 29, 2012 12:08
-
-
Save lance/2828087 to your computer and use it in GitHub Desktop.
Toggle VPN
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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