mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Apply config again only for very old config or needed settings
This commit is contained in:
parent
5df9ee2856
commit
f895376029
6 changed files with 199 additions and 192 deletions
|
@ -1,5 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ "$(uci -q get openmptcprouter.latest_versions)" = "" ]; then
|
||||||
NBCPU=$(grep -c '^processor' /proc/cpuinfo | tr -d "\n")
|
NBCPU=$(grep -c '^processor' /proc/cpuinfo | tr -d "\n")
|
||||||
if [ "$NBCPU" -gt 2 ]; then
|
if [ "$NBCPU" -gt 2 ]; then
|
||||||
if [ "$(uci -q get shadowsocks-libev.hi3)" = "" ]; then
|
if [ "$(uci -q get shadowsocks-libev.hi3)" = "" ]; then
|
||||||
|
@ -52,7 +53,7 @@ if [ "$(uci -q get shadowsocks-libev.hi.mode)" != "tcp" ]; then
|
||||||
commit shadowsocks-libev
|
commit shadowsocks-libev
|
||||||
EOF
|
EOF
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
rm -f /tmp/luci-indexcache
|
rm -f /tmp/luci-indexcache
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
if [ "$(uci -q openmptcprouter.latest_versions)" = "" ]; then
|
||||||
if [ "$(uci -q get unbound.@unbound[0].listen_port | grep 5353)" = "" ]; then
|
if [ "$(uci -q get unbound.@unbound[0].listen_port | grep 5353)" = "" ]; then
|
||||||
uci -q batch <<-EOF >/dev/null
|
uci -q batch <<-EOF >/dev/null
|
||||||
set unbound.@unbound[-1].listen_port=5353
|
set unbound.@unbound[-1].listen_port=5353
|
||||||
|
@ -15,6 +15,7 @@ if [ "$(uci -q show dhcp | grep 127.0.0.1#5353)" = "" ]; then
|
||||||
commit dhcp
|
commit dhcp
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
uci -q batch <<-EOF >/dev/null
|
uci -q batch <<-EOF >/dev/null
|
||||||
set dhcp.@dnsmasq[-1].noresolv=1
|
set dhcp.@dnsmasq[-1].noresolv=1
|
||||||
set dhcp.@dnsmasq[-1].nonegcache=1
|
set dhcp.@dnsmasq[-1].nonegcache=1
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
if [ "$(uci -q openmptcprouter.latest_versions)" ]; then
|
||||||
if [ "$(uci -q get qos.wan1)" = "" ]; then
|
if [ "$(uci -q get qos.wan1)" = "" ]; then
|
||||||
uci -q batch <<-EOF >/dev/null
|
uci -q batch <<-EOF >/dev/null
|
||||||
delete qos.wan
|
delete qos.wan
|
||||||
|
@ -46,6 +46,7 @@ if [ "$(uci -q get qos.wan1)" = "" ]; then
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
rm -f /tmp/luci-indexcache
|
rm -f /tmp/luci-indexcache
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
if [ "$(uci -q get openmptcprouter.latest_versions)" = "" ]; then
|
||||||
wanintf="$(uci -q get network.wan1.ifname)"
|
wanintf="$(uci -q get network.wan1.ifname)"
|
||||||
if [ "$(uci -q get vnstat.@vnstat[-1].interface | grep $wanintf)" = "" ]; then
|
if [ "$(uci -q get vnstat.@vnstat[-1].interface | grep $wanintf)" = "" ]; then
|
||||||
uci -q batch <<-EOF >/dev/null
|
uci -q batch <<-EOF >/dev/null
|
||||||
|
@ -27,6 +27,7 @@ if [ "$(uci -q get vnstat.@vnstat[-1].interface | grep $wanintf)" = "" ]; then
|
||||||
commit vnstat
|
commit vnstat
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
rm -f /tmp/luci-indexcache
|
rm -f /tmp/luci-indexcache
|
||||||
echo '0 */2 * * * /etc/init.d/vnstat_backup backup' > /etc/crontabs/root
|
echo '0 */2 * * * /etc/init.d/vnstat_backup backup' > /etc/crontabs/root
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ "$(uci -q openmptcprouter.latest_versions)" = "" ]; then
|
||||||
uci -q show wireless.default_radio0 && {
|
uci -q show wireless.default_radio0 && {
|
||||||
uci -q batch <<-EOF >/dev/null
|
uci -q batch <<-EOF >/dev/null
|
||||||
delete wireless.default_radio0
|
delete wireless.default_radio0
|
||||||
commit wireless
|
commit wireless
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
if [ "$(uci -q openmptcprouter.latest_versions)" = "" ]; then
|
||||||
if [ "$(uci -q get sqm.wan1)" = "" ]; then
|
if [ "$(uci -q get sqm.wan1)" = "" ]; then
|
||||||
wan1="$(uci -q get network.wan1.ifname)"
|
wan1="$(uci -q get network.wan1.ifname)"
|
||||||
wan2="$(uci -q get network.wan2.ifname)"
|
wan2="$(uci -q get network.wan2.ifname)"
|
||||||
|
@ -64,6 +64,7 @@ if [ "$(uci -q get sqm.wan1)" = "" ]; then
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
rm -f /tmp/luci-indexcache
|
rm -f /tmp/luci-indexcache
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue