1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00
This commit is contained in:
suyuan 2025-02-19 19:43:13 +08:00 committed by GitHub
commit eab95d1fd7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 16 additions and 4 deletions

View file

@ -28,7 +28,7 @@ if [ -n "$OMR_TRACKER_INTERFACE" ] && [ -n "$OMR_TRACKER_DEVICE" ] && [ "$OMR_TR
fi
fi
if [ -n "$(grep z8102ax /etc/board.json)" ]; then
if [ -n "$(grep z8102ax /etc/board.json)" ] && [ "$(uci -q get network.modem1.proto)" = "modemmanager" ]; then
if [ -e /sys/devices/platform/soc/11200000.usb/usb1/1-1/1-1.1 ]; then
uci -q batch <<-EOF
set network.modem1.device='/sys/devices/platform/soc/11200000.usb/usb1/1-1/1-1.1'
@ -42,7 +42,7 @@ if [ -n "$(grep z8102ax /etc/board.json)" ]; then
fi
[ -n "$(uci -q changes network)" ] && uci -q commit network
fi
if [ -n "$(grep z8109ax /etc/board.json)" ]; then
if [ -n "$(grep z8109ax /etc/board.json)" ] && [ "$(uci -q get network.modem1.proto)" = "modemmanager" ]; then
if [ -e /sys/devices/platform/soc/11200000.usb/usb1/1-1/1-1.1 ]; then
uci -q batch <<-EOF
set network.modem1.device='/sys/devices/platform/soc/11200000.usb/usb1/1-1/1-1.1'

View file

@ -106,6 +106,8 @@ fi
lanif="eth0"
if [ "$(cat /etc/board.json | jsonfilter -q -e '@.model.id' | tr -d '\n')" = "friendlyarm,nanopi-r5c" ]; then
lanif="eth0"
elif [ "$(cat /etc/board.json | jsonfilter -q -e '@.model.id' | tr -d '\n')" = "bananapi,bpi-r4" ] || [ "$(cat /etc/board.json | jsonfilter -q -e '@.model.id' | tr -d '\n')" = "bananapi,bpi-r4-poe" ]; then
lanif="wan"
elif [ "$(grep rockchip /etc/os-release)" != "" ]; then
lanif="eth1"
elif [ "$(grep filogic /etc/os-release)" != "" ]; then
@ -259,6 +261,10 @@ if [ "$(uci -q show network.wan1 | grep multipath)" = "" ] && [ -z "$(uci -q get
_setup_wan_interface wan2 eth1.2 on
_setup_wan_interface wan3 eth1.3 on
_setup_wan_interface wan4 eth1.4 on
elif [ "$(cat /etc/board.json | jsonfilter -q -e '@.model.id' | tr -d '\n')" = "bananapi,bpi-r4" ] || [ "$(cat /etc/board.json | jsonfilter -q -e '@.model.id' | tr -d '\n')" = "bananapi,bpi-r4-poe" ]; then
_setup_wan_interface wan1 lan1 master
_setup_wan_interface wan2 lan2 on
_setup_wan_interface wan3 lan3 on
elif [ "$(cat /etc/board.json | jsonfilter -q -e '@.model.id' | tr -d '\n')" = "friendlyarm,nanopi-r5c" ]; then
_setup_wan_interface wan1 eth1 master macvlan
_setup_wan_interface wan2 eth1 on macvlan
@ -340,6 +346,10 @@ if [ "$(uci -q show network.wan1 | grep multipath)" = "" ] && [ -z "$(uci -q get
_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/')}"
if [ -d /sys/class/net/lan5 -o -n "$(ip link | grep ' lan5')" ]; then
_macaddr=$(uci -q get "network.lan5.macaddr")
_setup_macaddr "wan5" "${_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
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
@ -402,8 +412,8 @@ if [ "$(uci -q show network.wan1 | grep multipath)" = "" ] && [ -z "$(uci -q get
_setup_wan_interface wan2 lan3 on
_setup_wan_interface wan3 lan4 on
if [ -d /sys/class/net/10g-1 ] && [ -d /sys/class/net/10g-2 ]; then
_setup_wan_interface wan3 10g-1 on
_setup_wan_interface wan3 10g-2 on
_setup_wan_interface wan4 10g-1 on
_setup_wan_interface wan5 10g-2 on
fi
else
_setup_wan_interface wan1 eth0 master macvlan

View file

@ -1,2 +1,3 @@
#!/bin/sh
[ "$(uci -q get v2ray.main_dns.enabled)" = "1" ] && /etc/init.d/v2ray rules_up
exit 0

View file

@ -1,2 +1,3 @@
#!/bin/sh
[ "$(uci -q get xray.main_dns.enabled)" = "1" ] && /etc/init.d/xray rules_up
exit 0