Skip to content

Instantly share code, notes, and snippets.

@rogerz
Created May 25, 2014 01:54
Show Gist options
  • Save rogerz/bb005eec1d8640f23081 to your computer and use it in GitHub Desktop.
Save rogerz/bb005eec1d8640f23081 to your computer and use it in GitHub Desktop.
auto connect to VPN
on idle
tell application "System Events"
tell current location of network preferences
set vpn to the service "VPN name"
if vpn is not null then
if current configuration of vpn is not connected then
connect vpn
end if
end if
end tell
return 120
end tell
end idle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment