op-packages/mnh/files/mnh.defaults
github-actions[bot] 32600acc60 🌴 Sync 2026-03-05 23:51:42
2026-03-05 23:51:42 +08:00

38 lines
760 B
Bash

#!/bin/sh
[ ! -f "/usr/share/ucitrack/luci-app-mnh.json" ] && {
cat > /usr/share/ucitrack/luci-app-mnh.json << EEOF
{
"config": "mnh",
"init": "mnh"
}
EEOF
}
uci -q batch <<-EOF >/dev/null
delete ucitrack.@mnh[-1]
add ucitrack mnh
set ucitrack.@mnh[-1].init=mnh
commit ucitrack
EOF
if fw4 >/dev/null; then
uci -q batch <<-EOF
delete firewall.mnh
set firewall.mnh=include
set firewall.mnh.type=script
set firewall.mnh.path=/usr/share/mnh/firewall4.include
commit firewall
EOF
else
uci -q batch <<-EOF
delete firewall.mnh
set firewall.mnh=include
set firewall.mnh.type=script
set firewall.mnh.path=/usr/share/mnh/firewall3.include
set firewall.mnh.family=ipv4
set firewall.mnh.reload=1
commit firewall
EOF
fi
exit 0