Detect internet lost and reboot modem

Hi! Is there any way the hub can trigger a routine when it realizes it lost internet connection?

What I am looking for is for it to:
Switch off a plug
Wait 10 seconds
Switch on a plug

This way I can attach the modem to that plug and the hub will regain connection even if I am not there.