Last active
March 2, 2020 09:37
-
-
Save brucebentley/0f1c37318929b664abf5bf765a89d487 to your computer and use it in GitHub Desktop.
Keep your VPN connected ( macOS )
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" | |
| tell current location of network preferences | |
| set VPNService to the service "vpn-bruce" -- Replace this with the name of your VPN connection. | |
| if VPNService is not null then | |
| if current configuration of VPNService is not connected then | |
| connect VPNService | |
| end if | |
| end if | |
| end tell | |
| -- In "idle" blocks, the number returned is how long to sleep until running again. | |
| return 60 | |
| end tell | |
| end idle |
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" | |
| tell current location of network preferences | |
| set VPNService to the service "vpn-bruce" -- Replace this with the name of your VPN connection. | |
| if VPNService is not null then | |
| if current configuration of VPNService is not connected then | |
| beep | |
| beep | |
| beep | |
| connect VPNService | |
| end if | |
| end if | |
| end tell | |
| end tell | |
| -- In "idle" blocks, the number returned is how long to sleep until running again. | |
| return 60 | |
| end idle |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment