mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-27 22:13:11 +08:00
34 lines
825 B
Bash
34 lines
825 B
Bash
#!/bin/sh
|
|
[ ! -f "/usr/share/ucitrack/luci-app-devgate.json" ] && {
|
|
cat > /usr/share/ucitrack/luci-app-devgate.json << EEOF
|
|
{
|
|
"config": "devgate",
|
|
"init": "devgate"
|
|
}
|
|
EEOF
|
|
}
|
|
chmod +x /etc/init.d/devgate /usr/bin/devgate*
|
|
uci -q batch <<-EOF >/dev/null
|
|
delete ucitrack.@devgate[-1]
|
|
add ucitrack devgate
|
|
set ucitrack.@devgate[-1].init=devgate
|
|
commit ucitrack
|
|
EOF
|
|
|
|
[ -e /etc/config/devgate ] || cat > /etc/config/devgate <<'EOF'
|
|
config device
|
|
option enable '0'
|
|
option mac ''
|
|
option time_ranges '00:00-00:00'
|
|
option week '0'
|
|
option chain 'forward'
|
|
EOF
|
|
rm -f /etc/config/devgate-opkg
|
|
|
|
/etc/init.d/devgate enable >/dev/null 2>&1 || true
|
|
/etc/init.d/devgate start >/dev/null 2>&1 || true
|
|
|
|
rm -rf /tmp/luci-indexcache /tmp/luci-modulecache /tmp/luci-*cache
|
|
/etc/init.d/rpcd reload >/dev/null 2>&1 || true
|
|
exit 0
|