Change the gateway according to a predetermined schedule.

I need a script that allows change the gateway according to a predetermined schedule. For example: gateway1 = 200.200.200.200 from 6am to 6pm and gateway2 = 100.100.100.100 6pm to 6am Thank you for your contributions.

schedule the instruction like:

/ip route
disable [find where comment="from 6pm to 6am"]; enable [find where comment="from 6am to 6pm"];

just comment accordingly the two rute you want switch.