Toggling firewall rules on&off through uci is not the same as in luci

I have a problem that after a reboot 2 of my firewall rules that redirect incoming traffic on port 80 & 443 to nginx are not loaded (dunno why, seems to be a bug in the firewall)

I tried with a simple “/etc/init.d/firewall restart” after booting but that doesn’t help. I have to go to luci and have to disable the rules. Then save&apply. Enable the rules and again glick on save&apply then the rules start working.

so I started scripting this like this:

#/bin/bash
uci set firewall.wan_http_turris_rule.enabled='0'
uci set firewall.wan_https_turris_rule.enabled='0'
uci commit firewall
/etc/init.d/firewall restart >/dev/null
sleep 1
uci set firewall.wan_http_turris_rule.enabled='1'
uci set firewall.wan_https_turris_rule.enabled='1'
uci commit firewall
/etc/init.d/firewall restart

But that does not do the trick. The rules are still not working.

I can confirm that disabling & enabling the rules works I I execute just the uci commands and check their status in luci.

But “save&apply” does not seems to a simple combination of “uci commit” and “/etc/init.d/firewall restart” there must be something different that is beeing done in luci that I’m missing.

Does anbody maybe the devs know what exactly “save&apply” is doing in terms of shell commands as I’m out of ideas why the script does not have the same effect.

As this is openwrt core I’d suggest to ask this question in the openwrt forum were you might get a better audience.

Add reload_config after commit.