mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-07-29 12:51:49 +08:00
38 lines
760 B
Bash
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 |