Created
August 10, 2012 17:35
-
-
Save netoxico/3315989 to your computer and use it in GitHub Desktop.
Mac - Toggling VPN Connection
This file contains hidden or 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
#!/bin/sh | |
osascript <<END | |
tell application "System Events" | |
tell current location of network preferences | |
set VPNservice to service "VPN-NAME" | |
set isConnected to connected of current configuration of VPNservice | |
if isConnected then | |
disconnect VPNservice | |
else | |
connect VPNservice | |
end if | |
end tell | |
end tell | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment