I have the following script. it automatically reconnects the VPN connection if the VPN connection drops. I want to edit this script I want it to connect automatically between 6pm and 8am. So, if the connection drops (let's say) at 11am or 3pm the script won't try to reconnect the VPN but if the connection drops between at 6pm and 8am then it will try to reconnect. How this can be done? I would be grateful if someone can help with the editing of the script. Thank you very much in advance.
Code:
on idle
tell application "System Events"
tell current location of network preferences
set myVPN to the service "VPN NAME"
if myVPN is not null then
if current configuration of myVPN is not connected then
connect myVPN
end if
end if
end tell
return 60
end tell
end idle
Last edited: