You probably watn to reconnect. I can’t remember how I used to script this, but there are a lot of script examples on the internet. You would want to place it in an idle handler or something that monitors the connection.
on idle
-- check status or state of internet connect
-- if not connected then connect
return 5 -- every 5 seconds to check
end idle