#!/bin/sh
# Register the fw3 firewall include on iptables-only firmwares. fw4 systems
# use the nftables drop-in (/usr/share/nftables.d/chain-pre/forward) instead
# and would reject the legacy `reload` option, so skip them.
command -v fw4 >/dev/null 2>&1 && exit 0
uci -q get firewall.ednovas >/dev/null && exit 0
uci set firewall.ednovas=include
uci set firewall.ednovas.type='script'
uci set firewall.ednovas.path='/usr/share/ednovas/firewall.include.sh'
uci set firewall.ednovas.reload='1'
uci commit firewall
exit 0
