1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Merge branch 'develop'

This commit is contained in:
suyuan 2020-12-24 15:17:29 +08:00
commit 8af454a1db
147 changed files with 2964 additions and 2145 deletions

View file

@ -13,6 +13,11 @@ if [ "$(uci -q get openmptcprouter.latest_versions)" = "" ]; then
uci -q batch <<-EOF >/dev/null
add_list dhcp.@dnsmasq[-1].server="127.0.0.1#5353"
add_list dhcp.@dnsmasq[-1].server="/lan/"
#add_list dhcp.@dnsmasq[-1].server="223.5.5.5#53"
#add_list dhcp.@dnsmasq[-1].server="223.6.6.6#53"
#add_list dhcp.@dnsmasq[-1].server="180.76.76.76#53"
#add_list dhcp.@dnsmasq[-1].server="208.67.222.222#5353"
#add_list dhcp.@dnsmasq[-1].server="208.67.220.220#5353"
commit dhcp
EOF
fi

View file

@ -157,6 +157,11 @@ uci -q del firewall.@zone[1].network
for intf in $allintf; do
uci -q add_list firewall.@zone[1].network=$intf
done
allintf=$(uci -q get firewall.zone_vpn.network)
uci -q del firewall.zone_vpn.network
for intf in $allintf; do
uci -q add_list firewall.zone_vpn.network=$intf
done
uci -q batch <<-EOF >/dev/null
set firewall.@zone[0].mtu_fix='1'

View file

@ -2,8 +2,9 @@
if [ "$(uci -q get openmptcprouter.settings.disable_ipv6)" != "0" ]; then
uci -q batch <<-EOF >/dev/null
set dhcp.lan.ra_default=1
set dhcp.lan.dhcpv6=server
delete dhcp.lan.ra_default
delete dhcp.lan.dhcpv6
delete dhcp.lan.ra
set dhcp.lan.force=1
commit dhcp
EOF

View file

@ -24,6 +24,13 @@ if [ "$(uci -q get glorytun.vpn.localip)" = "10.0.0.2" ]; then
EOF
fi
if [ "$(uci -q get network.omrvpn.txqueuelen)" = "1000" ]; then
uci -q batch <<-EOF >/dev/null
set network.omrvpn.txqueuelen=100
commit network
EOF
fi
if [ "$(uci -q get openvpn.omr.proto)" != "tcp-client" ]; then
uci -q batch <<-EOF >/dev/null
set openvpn.omr=openvpn
@ -67,11 +74,18 @@ if [ "$(uci -q get dsvpn.vpn)" = "" ]; then
set dsvpn.vpn.port=65011
set dsvpn.vpn.localip=10.255.251.2
set dsvpn.vpn.remoteip=10.255.251.1
set dsvpn.vpn.mode=client
set dsvpn.vpn.enable=0
commit dsvpn
EOF
fi
if [ "$(uci -q get dsvpn.vpn.mode)" = "" ]; then
uci -q batch <<-EOF >/dev/null
set dsvpn.vpn.mode=client
commit dsvpn
EOF
fi
if [ "$(uci -q show firewall | grep omrvpn)" = "" ]; then
uci -q batch <<-EOF >/dev/null
@ -93,6 +107,12 @@ if [ "$(uci -q get ucitrack.@network[-1].affects | grep glorytun)" = "" ]; then
commit ucitrack
EOF
fi
if [ "$(uci -q get ucitrack.@network[-1].affects | grep glorytun-udp)" = "" ]; then
uci -q batch <<-EOF >/dev/null
add_list ucitrack.@network[-1].affects="glorytun-udp"
commit ucitrack
EOF
fi
if [ "$(uci -q get ucitrack.@network[-1].affects | grep dsvpn)" = "" ]; then
uci -q batch <<-EOF >/dev/null
add_list ucitrack.@network[-1].affects="dsvpn"
@ -105,6 +125,28 @@ if [ "$(uci -q get ucitrack.@glorytun[-1].affects | grep openmptcprouter-vps)" =
commit ucitrack
EOF
fi
if [ "$(uci -q get ucitrack.@glorytun-udp[-1].affects | grep openmptcprouter-vps)" = "" ]; then
uci -q batch <<-EOF >/dev/null
add_list ucitrack.@glorytun-udp[-1].affects="openmptcprouter-vps"
commit ucitrack
EOF
fi
if [ "$(uci -q get glorytun-udp.vpn.key)" = "" ] && [ "$(uci -q get glorytun.vpn.key)" != "" ]; then
uci -q batch <<-EOF >/dev/null
set glorytun-udp.vpn.key=$(uci -q get glorytun.vpn.key)
set glorytun-udp.vpn.host=$(uci -q get glorytun.vpn.host)
EOF
if [ "$(uci -q get glorytun-udp.vpn.proto)" = "udp" ]; then
uci -q batch <<-EOF >/dev/null
set glorytun-udp.vpn.enable=1
set glorytun.vpn.enable=0
commit glorytun
EOF
fi
uci -q commit glorytun-udp
fi
rm -f /tmp/luci-indexcache

View file

@ -1,8 +1,10 @@
#!/bin/sh
uci -q batch <<-EOF >/dev/null
set uhttpd.main.redirect_https=0
set uhttpd.main.script_timeout=240
set uhttpd.main.network_timeout=240
set uhttpd.main.http_keepalive=0
EOF
if [ "$(uci -q get openmptcprouter.settings.version)" = "" ]; then
uci -q batch <<-EOF >/dev/null
set uhttpd.main.redirect_https=0
set uhttpd.main.script_timeout=240
set uhttpd.main.network_timeout=240
set uhttpd.main.http_keepalive=0
EOF
fi
exit 0

View file

@ -6,17 +6,27 @@ uci -q batch <<-EOF >/dev/null
commit system
set rpcd.@rpcd[0].timeout=120
commit rpcd
luci.apply.timeout='20'
set luci.apply.timeout='20'
commit luci
fstab.@global[0].check_fs='1'
set fstab.@global[0].check_fs='1'
commit fstab
EOF
if [ "$(uci -q get rpcd.@rpcd[0].socket)" != "/var/run/ubus/ubus.sock" ]; then
uci -q batch <<-EOF >/dev/null
set rpcd.@rpcd[0].socket='/var/run/ubus/ubus.sock'
commit rpcd
EOF
fi
/sbin/block detect > /etc/config/fstab
[ -n "$(ubus call system board | jsonfilter -e '@.board_name' | grep raspberry)" ] && [ "$(uci -q get openmptcprouter.settings.scaling_governor)" != "performance" ] && {
# force CPU speed for RPI
uci -q set openmptcprouter.settings.scaling_min_freq=$(cat /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq | tr -d "\n")
uci -q set openmptcprouter.settings.scaling_max_freq=$(cat /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq | tr -d "\n")
uci -q set openmptcprouter.settings.scaling_governor='performance'
uci -q commit openmptcprouter
}
exit 0