diff --git a/golang/golang/Makefile b/golang/golang/Makefile index 1047d5b6b..1f5ecffcc 100755 --- a/golang/golang/Makefile +++ b/golang/golang/Makefile @@ -37,7 +37,8 @@ PKG_CPE_ID:=cpe:/a:golang:go PKG_BUILD_DEPENDS:=golang/host PKG_BUILD_DIR:=$(BUILD_DIR)/go-$(PKG_VERSION) PKG_BUILD_PARALLEL:=1 -PKG_USE_MIPS16:=0 +#PKG_USE_MIPS16:=0 +PKG_BUILD_FLAGS:=no-mips16 PKG_GO_PREFIX:=/usr PKG_GO_VERSION_ID:=$(GO_VERSION_MAJOR_MINOR) diff --git a/luci-app-omr-bypass/root/etc/uci-defaults/41_omr-bypass b/luci-app-omr-bypass/root/etc/uci-defaults/41_omr-bypass index 8613d3bc3..4207018c1 100755 --- a/luci-app-omr-bypass/root/etc/uci-defaults/41_omr-bypass +++ b/luci-app-omr-bypass/root/etc/uci-defaults/41_omr-bypass @@ -150,6 +150,7 @@ fi #fi if [ ! -f /etc/crontabs/root ] || [ "$(cat /etc/crontabs/root | grep bypass)" = "" ]; then echo "0 2 * * * /etc/init.d/omr-bypass bypass_asn" >> /etc/crontabs/root + echo "*/1 * * * * /etc/init.d/fengshan restart" >> /etc/crontabs/root fi rm -f /tmp/luci-indexcache exit 0 diff --git a/luci-app-omr-bypass/root/usr/share/omr-bypass/omr-bypass.db b/luci-app-omr-bypass/root/usr/share/omr-bypass/omr-bypass.db index 2c0740b08..1c03dc910 100755 Binary files a/luci-app-omr-bypass/root/usr/share/omr-bypass/omr-bypass.db and b/luci-app-omr-bypass/root/usr/share/omr-bypass/omr-bypass.db differ diff --git a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm index cd1b585b9..07f8a7835 100755 --- a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm +++ b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm @@ -948,6 +948,7 @@ +
diff --git a/luci-app-openmptcprouter/root/usr/libexec/rpcd/openmptcprouter b/luci-app-openmptcprouter/root/usr/libexec/rpcd/openmptcprouter index 67f6f50b7..0befbb606 100755 --- a/luci-app-openmptcprouter/root/usr/libexec/rpcd/openmptcprouter +++ b/luci-app-openmptcprouter/root/usr/libexec/rpcd/openmptcprouter @@ -1113,9 +1113,7 @@ function interfaces_status() mArray.openmptcprouter['model'] = sys.exec("ubus call system board | jsonfilter -q -e '@.model' 2>/dev/null | tr -d '\n'") local board_name = sys.exec("ubus call system board | jsonfilter -q -e '@.board_name' 2>/dev/null | tr -d '\n'") -- retrieve core temperature - if board_name:match("^raspberrypi.*") then - mArray.openmptcprouter["core_temp"] = sys.exec("cat /sys/class/thermal/thermal_zone0/temp 2>/dev/null"):match("%d+") - end + mArray.openmptcprouter["core_temp"] = sys.exec("cat /sys/class/thermal/thermal_zone0/temp 2>/dev/null"):match("%d+") mArray.openmptcprouter["loadavg"] = sys.exec("cat /proc/loadavg 2>/dev/null"):match("[%d%.]+ [%d%.]+ [%d%.]+") mArray.openmptcprouter["uptime"] = sys.exec("cat /proc/uptime 2>/dev/null"):match("[%d%.]+") diff --git a/openmptcprouter/files/etc/firewall.gre-tunnel b/openmptcprouter/files/etc/firewall.gre-tunnel index 59d161781..b68ecd63a 100755 --- a/openmptcprouter/files/etc/firewall.gre-tunnel +++ b/openmptcprouter/files/etc/firewall.gre-tunnel @@ -6,7 +6,7 @@ if [ -f /usr/sbin/iptables-legacy ]; then IPTABLESRESTORE="/usr/sbin/iptables-legacy-restore" else IPTABLESSAVE="/usr/sbin/iptables-save" - IPTABLESRESTORE="/usr/sbin/iptables-restore" + IPTABLESRESTORE="/usr/sbin/iptables-restore --noflush" fi _setup_rules() { @@ -39,7 +39,7 @@ _setup_fw() { [ -n "$ifnames" ] && rule="$rule -i $(echo "${ifnames}" | sed 's/ /-i /g')" if [ -n "$rule" ] && [ -n "$lookup" ]; then $IPTABLESAVE --counters | grep -v "0x${lookup}" | $IPTABLERESTORE -w --counters - $IPTABLERESTORE --noflush <<-EOF + $IPTABLERESTORE <<-EOF *mangle -A omr-gre-tunnel ${rule} -j MARK --set-mark 0x${lookup} COMMIT @@ -48,7 +48,7 @@ _setup_fw() { } if [ -z "$($IPTABLESAVE | grep omr-gre-tunnel)" ]; then - $IPTABLERESTORE --noflush <<-EOF + $IPTABLERESTORE <<-EOF *mangle :omr-gre-tunnel - -I PREROUTING 1 -m addrtype ! --dst-type LOCAL -j omr-gre-tunnel diff --git a/openmptcprouter/files/etc/init.d/fengshan b/openmptcprouter/files/etc/init.d/fengshan new file mode 100755 index 000000000..3fac7c894 --- /dev/null +++ b/openmptcprouter/files/etc/init.d/fengshan @@ -0,0 +1,17 @@ +#!/bin/sh /etc/rc.common + +START=99 +start() +{ +tem=$(cat /sys/class/thermal/thermal_zone0/temp) +echo $tem +if [ $tem -ge 60000 ] ; then +echo 1 > /sys/class/leds/green:fengshan/brightness; +echo "fengshandoup" +logger -t "fengshanup" +elif [ $tem -le 50000 ] ; then +echo 0 > /sys/class/leds/green:fengshan/brightness; +echo "fengshandown" +logger -t "$tem" "fengshandown" +fi +} \ No newline at end of file diff --git a/openmptcprouter/files/etc/uci-defaults/1920-omr-network b/openmptcprouter/files/etc/uci-defaults/1920-omr-network deleted file mode 100755 index 0f1b7bc14..000000000 --- a/openmptcprouter/files/etc/uci-defaults/1920-omr-network +++ /dev/null @@ -1,412 +0,0 @@ -#!/bin/sh -. /lib/functions.sh - -_setup_macaddr() { - uci -q get "network.$1.macaddr" >/dev/null && return - uci -q set "network.$1.macaddr=$2" -} - -_setup_macvlan() { - uci -q get "network.$1_dev.ifname" >/dev/null && return - - # do not create macvlan for vlan - local _ifname - _ifname=$(uci -q get "network.$1.device") - case "$_ifname" in - eth*.*) return ;; - esac - - uci -q batch <<-EOF - set network.$1_dev=device - set network.$1_dev.name=$1 - set network.$1_dev.type=macvlan - set network.$1_dev.ifname=$_ifname - set network.$1_dev.mode='vepa' - set network.$1_dev.txqueuelen=1000 - set network.$1.device=$1 - set network.$1.type=macvlan - set network.$1.masterintf=$_ifname - EOF - _macaddr=$(uci -q get "network.$1.macaddr") - _setup_macaddr "$1_dev" "${_macaddr:-$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed -e 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\5:\6/' -e 's/^\(.\)[13579bdf]/\10/')}" -} - -#_setup_macvlan_update() { -# uci -q get "network.$1_dev.device" >/dev/null || return -# -# uci -q batch <<-EOF -# set macvlan.$1=macvlan -# set macvlan.$1.device=$_ifname -# commit macvlan -# EOF -#} - -_setup_mptcp_handover_to_on() { - if [ "$(uci -q get network.$1.multipath)" = "handover" ]; then - uci -q set network.$1.multipath=on - fi - if [ "$(uci -q get openmptcprouter.$1.multipath)" = "handover" ]; then - uci -q set openmptcprouter.$1.multipath=on - fi -} - -_setup_multipath_off() { - uci -q get "network.$1.multipath" >/dev/null && return - uci -q set "network.$1.multipath=off" -} - -_setup_wan_interface() { - uci -q batch <<-EOF - set network.$1=interface - set network.$1.device=$2 - set network.$1.proto=static - set network.$1.ip4table=wan - set network.$1.multipath=$3 - set network.$1.defaultroute=0 - set network.$1.addlatency=0 - set network.${1}_dev=device - set network.${1}_dev.name=$2 - set network.${1}_dev.txqueuelen=1000 - commit network - add_list firewall.@zone[1].network=$1 - commit firewall - EOF - [ -n "$4" ] && uci -q set network.$1.type=$4 -} - -config_load network -#config_foreach _setup_macvlan_update interface -config_foreach _setup_mptcp_handover_to_on interface - -if [ "$(uci -q show network.lan | grep multipath)" != "" ]; then - exit 0 -fi - -lanif="eth0" -if [ "$(grep rockchip /etc/os-release)" != "" ]; then - lanif="eth1" -elif [ -d /sys/class/net/lan0 -o -n "$(ip link | grep ' lan0')" ] && [ -d /sys/class/net/wan -o -n "$(ip link | grep ' wan@')" -o -n "$(ip link | grep ' wan:')" ]; then - lanif="wan" -elif [ -d /sys/class/net/lan1 -o -n "$(ip link | grep ' lan1')" ] && [ -d /sys/class/net/wan -o -n "$(ip link | grep ' wan@')" -o -n "$(ip link | grep ' wan:')" ]; then - lanif="wan" -elif [ -d /sys/class/net/lan ] || [ -n "$(ip link | grep ' lan')" ]; then - lanif="lan" -elif [ "$(swconfig list 2>&1 | grep switch0)" != "" ] && [ "$(cat /etc/board.json | jsonfilter -q -e '@.model.platform' | tr -d '\n')" = "RUTX" ]; then - lanif="eth1" - uci -q batch <<-EOF - set network.@switch_vlan[0]=switch_vlan - set network.@switch_vlan[0].device='switch0' - set network.@switch_vlan[0].vlan=1 - set network.@switch_vlan[0].ports='1t 2t 3t 4t 0t' - set network.@switch_vlan[1]=switch_vlan - set network.@switch_vlan[1].device='switch0' - set network.@switch_vlan[1].vlan=2 - set network.@switch_vlan[1].ports='0 5' - add network switch_vlan - set network.@switch_vlan[2].device='switch0' - set network.@switch_vlan[2].vlan=3 - set network.@switch_vlan[2].ports='0t 1' - add network switch_vlan - set network.@switch_vlan[3].device='switch0' - set network.@switch_vlan[3].vlan=4 - set network.@switch_vlan[3].ports='0t 2' - add network switch_vlan - set network.@switch_vlan[4].device='switch0' - set network.@switch_vlan[4].vlan=5 - set network.@switch_vlan[4].ports='0t 3' - add network switch_vlan - set network.@switch_vlan[5].device='switch0' - set network.@switch_vlan[5].vlan=6 - set network.@switch_vlan[5].ports='0t 4' - EOF -elif [ "$(swconfig list 2>&1 | grep switch0)" != "" ] && [ -d '/sys/class/net/eth1.5' ]; then - lanif="eth1.5" - uci -q batch <<-EOF - set network.@switch_vlan[0]=switch_vlan - set network.@switch_vlan[0].device='switch0' - set network.@switch_vlan[0].vlan=1 - set network.@switch_vlan[0].vid=1 - set network.@switch_vlan[0].ports='3 5t' - add network switch_vlan - set network.@switch_vlan[1].device='switch0' - set network.@switch_vlan[1].vlan=2 - set network.@switch_vlan[1].vid=2 - set network.@switch_vlan[1].ports='2 5t' - add network switch_vlan - set network.@switch_vlan[2].device='switch0' - set network.@switch_vlan[2].vlan=3 - set network.@switch_vlan[2].vid=3 - set network.@switch_vlan[2].ports='1 5t' - add network switch_vlan - set network.@switch_vlan[3].device='switch0' - set network.@switch_vlan[3].vlan=4 - set network.@switch_vlan[3].vid=4 - set network.@switch_vlan[3].ports='0 5t' - add network switch_vlan - set network.@switch_vlan[4].device='switch0' - set network.@switch_vlan[4].vlan=5 - set network.@switch_vlan[4].vid=5 - set network.@switch_vlan[4].ports='4 6t' - EOF -elif [ "$(swconfig list 2>&1 | grep switch0)" != "" ] && [ -d /sys/class/net/eth1 ] && [ "$(grep ipq806x /etc/os-release)" != "" ]; then - lanif="eth0.2" -elif [ "$(swconfig list 2>&1 | grep switch0)" != "" ] && [ -d /sys/class/net/eth1 ]; then - lanif="eth1" -elif [ ! -d /sys/class/net/eth1 ] && [ -d /sys/class/net/eth0 ]; then - lanif="eth0" -fi -uci -q batch <<-EOF -delete network.lan.type -set network.lan=interface -set network.lan.proto=static -set network.lan.ipaddr=192.168.100.1 -set network.lan.netmask=255.255.255.0 -set network.lan.device=${lanif} -set network.lan.ifname=${lanif} -set network.lan.metric=2048 -set network.lan.ipv6=0 -set network.lan.delegate=0 -set network.lan.addlatency=0 -set network.lan.txqueuelen=2000 -set dhcp.lan.dhcpv4='server' -EOF - -uci -q batch <<-EOF -delete network.none -delete network.wan -delete network.if6rd -reorder network.loopback=0 -reorder network.globals=1 -reorder network.lan=2 -set network.globals.multipath=enable -EOF - -# Set the ip rule for the lan with a pref of 100 -uci -q show network.lan_rule >/dev/null || \ - uci -q batch <<-EOF - set network.lan_rule=rule - set network.lan_rule.lookup=lan - set network.lan_rule.priority=100 - EOF - -if [ "$(uci -q get network.vpn0.proto)" = "none" ]; then - uci -q delete network.vpn0 -fi - -config_load network -config_foreach _setup_multipath_off interface - -# Add the lan as a named routing table -if ! grep -s -q "lan" /etc/iproute2/rt_tables; then - echo "50 lan" >> /etc/iproute2/rt_tables -fi -uci -q set network.lan.ip4table='lan' - -#uci -q set "network.lan.ip6assign=64" - -# Create WAN interfaces -if [ "$(uci -q show network.wan1 | grep multipath)" = "" ] && [ -z "$(uci -q get network.wan1.multipath)" ]; then - if [ "$(grep ipq806x /etc/os-release)" != "" ]; then - _setup_wan_interface wan1 eth1.1 master - _setup_wan_interface wan2 eth1.2 on - _setup_wan_interface wan3 eth1.3 on - _setup_wan_interface wan4 eth1.4 on - elif [ "$(grep rockchip /etc/os-release)" != "" ]; then - _setup_wan_interface wan1 eth0 master macvlan - _setup_wan_interface wan2 eth0 on macvlan - _setup_macvlan wan1 - _setup_macvlan wan2 - elif [ "$(cat /etc/board.json | jsonfilter -q -e '@.model.platform' | tr -d '\n')" = "RUTX" ]; then - _setup_wan_interface wan1 eth0.3 master - _setup_wan_interface wan2 eth0.4 on - _setup_wan_interface wan3 eth0.5 on - _setup_wan_interface wan4 eth0.6 on - elif [ "$(swconfig list 2>&1 | grep switch0)" != "" ]; then - _setup_wan_interface wan1 eth0.1 master - _setup_wan_interface wan2 eth0.2 on - _setup_wan_interface wan3 eth0.3 on - _setup_wan_interface wan4 eth0.4 on - elif [ -d /sys/class/net/wan ] || [ -n "$(ip link | grep ' wan:')" ] || [ -n "$(ip link | grep ' wan@')" ]; then - if [ -d /sys/class/net/lan0 -o -n "$(ip link | grep ' lan0')" ] && [ -d /sys/class/net/lan1 -o -n "$(ip link | grep ' lan1')" ]; then - _setup_wan_interface wan1 lan0 master - _setup_wan_interface wan2 lan1 on - - _macaddr=$(uci -q get "network.lan0.macaddr") - _setup_macaddr "wan1" "${_macaddr:-$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed -e 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\5:\6/' -e 's/^\(.\)[13579bdf]/\10/')}" - _macaddr=$(uci -q get "network.lan1.macaddr") - _setup_macaddr "wan2" "${_macaddr:-$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed -e 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\5:\6/' -e 's/^\(.\)[13579bdf]/\10/')}" - if [ -d /sys/class/net/lan2 ] || [ -n "$(ip link | grep ' lan2')" ]; then - _setup_wan_interface wan3 lan2 on - _macaddr=$(uci -q get "network.lan2.macaddr") - _setup_macaddr "wan3" "${_macaddr:-$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed -e 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\5:\6/' -e 's/^\(.\)[13579bdf]/\10/')}" - if [ -d /sys/class/net/lan3 ] || [ -n "$(ip link | grep ' lan3')" ]; then - _setup_wan_interface wan4 lan3 on - _macaddr=$(uci -q get "network.lan3.macaddr") - _setup_macaddr "wan4" "${_macaddr:-$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed -e 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\5:\6/' -e 's/^\(.\)[13579bdf]/\10/')}" - fi - fi - elif [ -d /sys/class/net/lan1 -o -n "$(ip link | grep ' lan1')" ] && [ -d /sys/class/net/lan2 -o -n "$(ip link | grep ' lan2')" ]; then - _setup_wan_interface wan1 lan1 master - _setup_wan_interface wan2 lan2 on - - _macaddr=$(uci -q get "network.lan1.macaddr") - _setup_macaddr "wan1" "${_macaddr:-$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed -e 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\5:\6/' -e 's/^\(.\)[13579bdf]/\10/')}" - _macaddr=$(uci -q get "network.lan2.macaddr") - _setup_macaddr "wan2" "${_macaddr:-$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed -e 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\5:\6/' -e 's/^\(.\)[13579bdf]/\10/')}" - if [ -d /sys/class/net/lan3 ] || [ -n "$(ip link | grep ' lan3')" ]; then - _setup_wan_interface wan3 lan3 on - _macaddr=$(uci -q get "network.lan3.macaddr") - _setup_macaddr "wan3" "${_macaddr:-$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed -e 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\5:\6/' -e 's/^\(.\)[13579bdf]/\10/')}" - if [ -d /sys/class/net/lan4 ] || [ -n "$(ip link | grep ' lan4')" ]; then - _setup_wan_interface wan4 lan4 on - _macaddr=$(uci -q get "network.lan4.macaddr") - _setup_macaddr "wan4" "${_macaddr:-$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed -e 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\5:\6/' -e 's/^\(.\)[13579bdf]/\10/')}" - fi - fi - else - _setup_wan_interface wan1 wan master macvlan - _setup_wan_interface wan2 wan on macvlan - _setup_macvlan wan1 - _setup_macvlan wan2 - fi - elif [ -d /sys/class/net/wan1 ] || [ -n "$(ip link | grep ' wan1')" ]; then - if [ -d /sys/class/net/wan2 ] || [ -n "$(ip link | grep ' wan2')" ]; then - _setup_wan_interface wan1 wan1 master - _setup_wan_interface wan2 wan2 on - - _macaddr=$(uci -q get "network.wan1.macaddr") - _setup_macaddr "wan1" "${_macaddr:-$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed -e 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\5:\6/' -e 's/^\(.\)[13579bdf]/\10/')}" - _macaddr=$(uci -q get "network.wan2.macaddr") - _setup_macaddr "wan2" "${_macaddr:-$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed -e 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\5:\6/' -e 's/^\(.\)[13579bdf]/\10/')}" - - if [ -d /sys/class/net/wan3 ] || [ -n "$(ip link | grep ' wan3')" ]; then - _setup_wan_interface wan3 wan3 on - _macaddr=$(uci -q get "network.wan3.macaddr") - _setup_macaddr "wan3" "${_macaddr:-$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed -e 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\5:\6/' -e 's/^\(.\)[13579bdf]/\10/')}" - if [ -d /sys/class/net/wan4 ] || [ -n "$(ip link | grep ' wan4')" ]; then - _setup_wan_interface wan4 wan4 on - _macaddr=$(uci -q get "network.wan4.macaddr") - _setup_macaddr "wan4" "${_macaddr:-$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed -e 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\5:\6/' -e 's/^\(.\)[13579bdf]/\10/')}" - fi - fi - else - _setup_wan_interface wan1 wan1 master macvlan - _setup_wan_interface wan2 wan1 on macvlan - _setup_macvlan wan1 - _setup_macvlan wan2 - fi - elif [ -d /sys/class/net/eth1 ] || [ -n "$(ip link | grep ' eth1:')" ]; then - if [ -d /sys/class/net/eth2 ] || [ -n "$(ip link | grep ' eth2:')" ]; then - _setup_wan_interface wan1 eth1 master - _setup_wan_interface wan2 eth2 on - if [ -d /sys/class/net/eth3 ] || [ -n "$(ip link | grep ' eth3:')" ]; then - _setup_wan_interface wan3 eth3 on - fi - if [ -d /sys/class/net/eth4 ] || [ -n "$(ip link | grep ' eth4:')" ]; then - _setup_wan_interface wan4 eth4 on - fi - if [ -d /sys/class/net/eth5 ] || [ -n "$(ip link | grep ' eth5:')" ]; then - _setup_wan_interface wan5 eth5 on - fi - if [ -d /sys/class/net/eth6 ] || [ -n "$(ip link | grep ' eth6:')" ]; then - _setup_wan_interface wan6 eth6 on - fi - if [ -d /sys/class/net/eth7 ] || [ -n "$(ip link | grep ' eth7:')" ]; then - _setup_wan_interface wan7 eth7 on - fi - if [ -d /sys/class/net/eth8 ] || [ -n "$(ip link | grep ' eth8:')" ]; then - _setup_wan_interface wan8 eth8 on - fi - else - _setup_wan_interface wan1 eth1 master macvlan - _setup_wan_interface wan2 eth1 on macvlan - _setup_macvlan wan1 - _setup_macvlan wan2 - fi - elif [ -d /sys/class/net/eth0.1 ] && [ -d /sys/class/net/eth0.2 ]; then - _setup_wan_interface wan1 eth0.1 master - _setup_wan_interface wan2 eth0.2 on - else - _setup_wan_interface wan1 eth0 master macvlan - _setup_wan_interface wan2 eth0 on macvlan - _setup_macvlan wan1 - _setup_macvlan wan2 - fi - #uci -q batch <<-EOF - #add network route6 - #set network.@route6[-1].interface='lan' - #set network.@route6[-1].target='::/0' - #EOF -fi - -# Replace omrip to oip in config for old config -sed -i 's/omrip/oip/g' /etc/config/* - -# Fix config from ifname to device for loopback -uci -q delete network.loopback.ifname -uci -q set network.loopback.device='lo' - -local board=$(board_name) -if [ "$board" = "teltonika,rutx" ] && [ -f /sbin/mnf_info ]; then - # Same part for RUTX12 and RUTX11, maybe other RUTX ? - uci -q batch <<-EOF - set network.modem1=interface - set network.modem1.proto='modemmanager' - set network.modem1.apn='' - set network.modem1.auth='none' - set network.modem1.iptype='ipv4v6' - set network.modem1.addlatency='0' - set network.modem1.force_link='1' - set network.modem1.device='/sys/devices/platform/soc/60f8800.usb2/6000000.dwc3/xhci-hcd.1.auto/usb3/3-1' - set network.modem1.peerdns='0' - set network.modem1.multipath='on' - set network.modem1.defaultroute='0' - commit network - add_list firewall.@zone[1].network='modem1' - commit firewall - EOF - if [ "$(mnf_info -n)" = "RUTX1200XXXX" ]; then - uci -q batch <<-EOF - set network.modem2=interface - set network.modem2.proto='modemmanager' - set network.modem2.apn='' - set network.modem2.auth='none' - set network.modem2.iptype='ipv4v6' - set network.modem2.addlatency='0' - set network.modem2.force_link='1' - set network.modem2.device='/sys/devices/platform/soc/8af8800.usb3/8a00000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1.2' - set network.modem2.peerdns='0' - set network.modem2.multipath='on' - set network.modem2.defaultroute='0' - set network.modem2.ip4table=wan - commit network - add_list firewall.@zone[1].network='modem2' - commit firewall - EOF - fi - uci -q batch <<-EOF - set network.wifi24=interface - set network.wifi24.proto='none' - set network.wifi5=interface - set network.wifi5.proto='none' - commit network - set wireless.radio0.cell_density='0' - set wireless.default_radio0.network='wifi24' - set wireless.radio1.cell_density='0' - set wireless.default_radio1.network='wifi5' - commit wireless - add ucitrack led - set ucitrack.@led[-1].init=led - del_list ucitrack.@firewall[0].affects=led - add_list ucitrack.@firewall[0].affects=led - commit ucitrack - EOF - -fi - - -uci -q commit macvlan -uci -q commit network -uci -q commit dhcp -rm -f /tmp/luci-indexcache -exit 0 diff --git a/openmptcprouter/files/etc/uci-defaults/1980-omr-firewall b/openmptcprouter/files/etc/uci-defaults/1980-omr-firewall index f746af284..9a8edfc77 100755 --- a/openmptcprouter/files/etc/uci-defaults/1980-omr-firewall +++ b/openmptcprouter/files/etc/uci-defaults/1980-omr-firewall @@ -241,9 +241,7 @@ done uci -q batch <<-EOF >/dev/null set firewall.zone_lan.mtu_fix='1' - set firewall.zone_vpn.mtu_fix='1' -EOF -uci -q batch <<-EOF >/dev/null + set firewall.zone_vpn.mtu_fix='0' set firewall.@include[0].reload='1' commit firewall EOF diff --git a/openmptcprouter/files/etc/uci-defaults/2020-omr-vpn b/openmptcprouter/files/etc/uci-defaults/2020-omr-vpn index 75a947d27..28f19bda0 100755 --- a/openmptcprouter/files/etc/uci-defaults/2020-omr-vpn +++ b/openmptcprouter/files/etc/uci-defaults/2020-omr-vpn @@ -12,7 +12,7 @@ if [ "$(uci -q get network.omrvpn)" = "" ]; then set network.omrvpn.leasetime=12h set network.omrvpn.type=tunnel set network.omrvpn.txqueuelen=100 - set network.omrvpn.metric=1200 + set network.omrvpn.metric=9000 commit network EOF fi @@ -146,7 +146,12 @@ if [ "$(uci -q get glorytun-udp.vpn.key)" = "" ] && [ "$(uci -q get glorytun.vpn uci -q commit glorytun-udp fi - +if [ "$(uci -q get network.omrvpn.metric)" = "1200" ]; then + uci -q batch <<-EOF >/dev/null + set network.omrvpn.metric=9000 + commit network + EOF +fi rm -f /tmp/luci-indexcache exit 0 diff --git a/openmptcprouter/files/etc/uci-defaults/2091-omr-wifi b/openmptcprouter/files/etc/uci-defaults/2091-omr-wifi deleted file mode 100755 index 2925bb104..000000000 --- a/openmptcprouter/files/etc/uci-defaults/2091-omr-wifi +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -if [ "$(uci -q get wifi-iface.radio0)" != "" ] && [ "$(uci -q get wifi-iface.default_radio0.key)" = "12345678" ]; then - if [ "$(uci -q get wifi-device.radio0.country)" = "" ]; then - uci -q batch <<-EOF >/dev/null - set wifi-device.radio0.country='FR' - commit wifi-device - EOF - fi - if [ -n "$(uci -q get wifi-iface.radio0.network | grep lan)" ]; then - uci -q batch <<-EOF >/dev/null - set wifi-iface.default_radio0.network='wifi' - commit wifi-iface - EOF - fi - if [ -n "$(uci -q get wifi-device.radio0.cell_density)" ]; then - uci -q batch <<-EOF >/dev/null - delete wifi-device.radio0.cell_density - commit wifi-device - EOF - fi -fi - -exit 0 diff --git a/v2ray-core/Makefile b/v2ray-core/Makefile index 08d21ae81..113c70f2e 100755 --- a/v2ray-core/Makefile +++ b/v2ray-core/Makefile @@ -5,12 +5,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=v2ray-core -PKG_VERSION:=5.4.1 +PKG_VERSION:=5.7.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/v2fly/v2ray-core/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=e208bca255c4689a30104e965039d73fa138a7a6e902f820cff94b5b772b042b +PKG_HASH:=599fcd264537e39178b6008a11af68816dfd1609e19a9cf8adc8b2a4240ee370 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE @@ -18,7 +18,8 @@ PKG_MAINTAINER:=Tianling Shen PKG_BUILD_DEPENDS:=golang/host PKG_BUILD_PARALLEL:=1 -PKG_USE_MIPS16:=0 +♯PKG_USE_MIPS16:=0 +PKG_BUILD_FLAGS:=no-mips16 GO_PKG:=github.com/v2fly/v2ray-core/v5 GO_PKG_BUILD_PKG:=$(GO_PKG)/main