Skip to content

Instantly share code, notes, and snippets.

@kevinberny
Created January 21, 2014 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinberny/8546363 to your computer and use it in GitHub Desktop.
Save kevinberny/8546363 to your computer and use it in GitHub Desktop.
Disconnect Cisco Anyconnect VPN client and disable wireless (used when Ethernet is enabled at the office
do shell script "networksetup -setairportpower en0 off"
tell application "Cisco AnyConnect Secure Mobility Client"
activate
end tell
repeat until application "Cisco AnyConnect Secure Mobility Client" is running
delay 1
end repeat
tell application "System Events"
repeat until (window 1 of process "Cisco AnyConnect Secure Mobility Client" exists)
delay 1
end repeat
click button "Disconnect" of window 1 of application process "Cisco AnyConnect Secure Mobility Client"
end tell
tell application "Cisco AnyConnect Secure Mobility Client"
quit
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment