Skip to content

Instantly share code, notes, and snippets.

@henryaj
Created March 10, 2016 13:41
Show Gist options
  • Save henryaj/db2eb74ca1fe50d42586 to your computer and use it in GitHub Desktop.
Save henryaj/db2eb74ca1fe50d42586 to your computer and use it in GitHub Desktop.
AppleScript to keep a VPN connection alive
repeat
tell application "System Events"
tell current location of network preferences
set myConnection to the service "YOUR_VPN_NAME"
if myConnection is not null then
if current configuration of myConnection is not connected then
connect myConnection
end if
end if
end tell
end tell
delay 30
end repeat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment