Last active
December 8, 2015 19:15
-
-
Save kristopherjohnson/9a1c42cbdbc9472ad8a1 to your computer and use it in GitHub Desktop.
AppleScript app to keep VPN connection open
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
| on idle | |
| tell application "System Events" | |
| set vpn_name to "'My VPN'" | |
| set rc to do shell script "scutil --nc status " & vpn_name | |
| if rc does not start with "Connected" then | |
| do shell script "scutil --nc start " & vpn_name | |
| end if | |
| end tell | |
| return 120 | |
| end idle |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Replace "My VPN" with the name of your VPN (as set up in System Preferences > Network). save this AppleScript as an application and run it. Every two minutes, it will check whether that VPN is connected, and if not, re-establish the connection.