tsaoyu
8/24/2017 - 9:11 AM

mac_automatic_reconnect

set theVPN to "Uni"

set amIconnected to (paragraph 1 of (do shell script "scutil --nc show " & theVPN))
if amIconnected contains "(Connected)" then
	set theAction to "stop"
else if amIconnected contains "(Disconnected)" then
	set theAction to "start"
end if

do shell script "scutil --nc " & theAction & space & theVPN