Created
December 5, 2009 07:37
-
-
Save oskarhagberg/249610 to your computer and use it in GitHub Desktop.
AppleScript for toggling connection to a specific VPN network
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 "VPN Service Name goes here" | |
if exists VPNservice then | |
set isConnected to connected of current configuration of VPNservice | |
if isConnected then | |
disconnect VPNservice | |
else | |
connect VPNservice | |
end if | |
end if | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment