Created
June 28, 2020 13:00
-
-
Save vladkosinov/8d9448587a89ddd8811f47d8c657d35c to your computer and use it in GitHub Desktop.
MacOS reconnect VPN automatically
This file contains 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 | |
set MyVPNName to "VPN NAME IN NETWORK PREFERENCES" | |
tell application "System Events" | |
tell current location of network preferences | |
set myConnection to the service MyVPNName | |
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 | |
end idle |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment