I need to switch two port forwarding rules on and off by cron. I know that I could do it like this:
config redirect
option extra '-m time --timestart 08:00:00 --timestop 10:00:00 --weekdays Mon'
...
But those times need to be given in UTC, while the server depending on this rule and its cron daemon is using local timezone. Changing the server's time zone would bring too many problems. So I need a way to synchronize the switching of this rule on my router and the cron job on my server, to be on the safe side when DST is applied.
The most easiest way I can think of would be a cron based swapping of two different files /etc/config/firewall, one in which those two rules are enabled and one in which they are disabled, and restarting the firewall after swap.
That will certainly work, but I'm sure OpenWRT provides a much more elegant way of doing this, doesn't it?
I saw the options in the table you and pavelgl are referring to, but I didn't realize that those parameters could be turned used in of code like pavelgl showed me.
I guess I still have a lot to learn about OpenWRT, especially about uci and its configuration. It's quite different from all versions of Linux I have been using until now.
Thanks again for your help (both of you) and your patience!