1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-12 18:41:51 +00:00
This commit is contained in:
suyuan 2025-02-09 23:40:00 +08:00 committed by GitHub
commit 32d23efa93
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 89 additions and 42 deletions

View file

@ -8,7 +8,7 @@ jobs:
build:
strategy:
matrix:
OMR_TARGET: [bpi-r1, bpi-r2, bpi-r3, bpi-r4, bpi-r4-poe, bpi-r64, rpi2, rpi4, wrt32x, espressobin, r2s, rpi3, wrt3200acm, x86, x86_64, ubnt-erx, r4s, r7800, rutx12, rutx50, r5s, qnap-301w, rpi5, z8102ax_128m, z8102ax_64m, gl-mt6000]
OMR_TARGET: [bpi-r1, bpi-r2, bpi-r3, bpi-r4, bpi-r4-poe, bpi-r64, rpi2, rpi4, wrt32x, espressobin, r2s, rpi3, wrt3200acm, x86, x86_64, ubnt-erx, r4s, r7800, rutx12, rutx50, r5s, qnap-301w, rpi5, z8102ax_128m, z8102ax_64m, gl-mt6000, r5c]
OMR_KERNEL: [6.6, 6.12]
runs-on: ubuntu-latest
continue-on-error: true

View file

@ -95,7 +95,12 @@ return view.extend({
}
*/
o = s.option(form.Flag, 'server_http_test', _('Server http test'),
_('Check if connection work with http by sending a request to server'));
_('Check if connection work with http by sending a request to server API'));
o.rmempty = false;
o.modalonly = true;
o = s.option(form.Flag, 'server_test', _('Server test'),
_('Check if connection work by sending a ping or http request to server over all interfaces, failed if only current interface is not able to.'));
o.rmempty = false;
o.modalonly = true;

View file

@ -2,7 +2,6 @@
# Copyright (C) 2018-2020 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
START=98
STOP=10
USE_PROCD=1
EXTRA_COMMANDS="reload_rules bypass_asn"

View file

@ -2,7 +2,6 @@
# Copyright (C) 2018-2024 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter
START=98
STOP=10
USE_PROCD=1
EXTRA_COMMANDS="reload_rules bypass_asn"

View file

@ -1,5 +1,6 @@
#!/bin/sh
#
# Copyright (C) 2018-2023 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter
# Copyright (C) 2018-2025 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
@ -94,11 +95,13 @@ fi
if [ "$(pgrep rpcd)" = "" ] && [ -f /etc/init.d/rpcd ]; then
_log "Can't find rpcd, restart it..."
/etc/init.d/rpcd enable >/dev/null 2>&1
/etc/init.d/rpcd restart >/dev/null 2>&1
sleep 5
fi
if [ "$(pgrep dbus)" = "" ] && [ -f /etc/init.d/dbus ]; then
_log "Can't find dbus, restart it..."
/etc/init.d/dbus enable >/dev/null 2>&1
/etc/init.d/dbus restart >/dev/null 2>&1
sleep 5
fi
@ -123,6 +126,7 @@ if [ "$(uci -q get openmptcprouter.settings.disable_modemmanager)" != "1" ]; the
# /etc/init.d/modemmanager stop >/dev/null 2>&1
# sleep 5
fi
/etc/init.d/modemmanager enable >/dev/null 2>&1
fi
if [ "$(uci -q get v2ray.main.enabled)" = "1" ] && [ -f /etc/init.d/v2ray ] && [ "$(pgrep -f omr-tracker-v2ray)" = "" ] && [ "$(pgrep -f '/etc/init.d/omr-tracker')" = "" ]; then
_log "Can't find omr-tracker-v2ray, restart omr-tracker..."
@ -150,6 +154,7 @@ restart_omrtracker() {
config_get ifenabled "$1" auto
[ -z "$multipath" ] || [ "$multipath" = "off" ] && return
[ "$ifenabled" = "0" ] && return
/etc/init.d/omr-tracker enable
/etc/init.d/omr-tracker start_interface "$1"
sleep 10
}
@ -244,7 +249,7 @@ if [ -n "$(logread | tail -n 2 | grep 'Ring expansion failed')" ]; then
echo 1 > /sys/bus/pci/rescan
fi
if [ -f /etc/init.d/omr-bypass ] && [ -z "$(pgrep -f omr-bypass)" ] && (([ -e /usr/sbin/iptables-nft-save ] && [ "$(iptables-nft-save 2>/dev/null | grep omr-bypass)" = "" ]) || [ "$(iptables-save 2>/dev/null | grep omr-bypass)" = "" ]); then
if [ -f /etc/init.d/omr-bypass ] && [ -z "$(pgrep -f omr-bypass)" ] && ( ([ -e /usr/sbin/iptables-nft-save ] && [ "$(iptables-nft-save 2>/dev/null | grep omr-bypass)" = "" ]) || [ "$(iptables-save 2>/dev/null | grep omr-bypass)" = "" ]); then
_log "Can't find omr-bypass rules, restart omr-bypass..."
/etc/init.d/omr-bypass start >/dev/null 2>&1
sleep 5

View file

@ -1,3 +1,4 @@
#!/bin/sh
#
# Copyright (C) 2018-2023 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter
#

View file

@ -510,7 +510,7 @@ while true; do
OMR_TRACKER_STATUS="OK"
break
fi
elif [ "$serverip_ping" = false ] && [ "$OMR_TRACKER_STATUS" = "OK" ]; then
elif [ "$serverip_ping" = false ] && [ "$OMR_TRACKER_STATUS" = "OK" ] && [ "$OMR_TRACKER_SERVER_TEST" = "1" ]; then
if [ "$OMR_TRACKER_TYPE" = "ping" ]; then
_ping_server_all
fi
@ -627,7 +627,7 @@ while true; do
OMR_TRACKER_STATUS="OK"
break
fi
elif [ "$serverip_ping" = false ] && [ "$OMR_TRACKER_STATUS" = "OK" ]; then
elif [ "$serverip_ping" = false ] && [ "$OMR_TRACKER_STATUS" = "OK" ] && [ "$OMR_TRACKER_SERVER_TEST" = "1" ]; then
if [ "$OMR_TRACKER_TYPE" = "ping" ]; then
_ping_server_all
fi
@ -637,7 +637,7 @@ while true; do
if [ "$server_ping" != false ] && [ "$servers" = true ]; then
OMR_TRACKER_STATUS_MSG="$OMR_TRACKER_STATUS_MSG No answer from server"
OMR_TRACKER_STATUS="ERROR"
break
#break
fi
fi
[ "$OMR_TRACKER_STATUS" = "OK" ] && break

View file

@ -29,6 +29,7 @@ config defaults 'defaults'
option type 'ping'
option wait_test '0'
option server_http_test '0'
option server_test '0'
option restart_down '0'
option mail_alert '0'
option initial_state 'online'

View file

@ -1,13 +1,12 @@
#!/bin/sh /etc/rc.common
# shellcheck disable=SC2039
# vim: set noexpandtab tabstop=4 shiftwidth=4 softtabstop=4 :
# Copyright (C) 2018-2021 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
# Copyright (C) 2018-2025 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
# Released under GPL 3. See LICENSE for the full terms.
# shellcheck disable=SC2034
{
START=90
STOP=10
USE_PROCD=1
EXTRA_COMMANDS="start_interface"
}
@ -17,7 +16,7 @@
_validate_section() {
local tmp_hosts=$hosts tmp_hosts6=$hosts6 tmp_timeout=$timeout tmp_count=$count tmp_tries=$tries tmp_size=$size tmp_max_ttl=$max_ttl tmp_failure_loss=$failure_loss tmp_failure_latency=$failure_latency tmp_recovery_loss=$recovery_loss tmp_recovery_latency=$recovery_latency tmp_reliability=$reliability
local tmp_interval=$interval tmp_interval_tries=$interval_tries tmp_options=$options tmp_type=$type tmp_enabled=$enabled tmp_wait_test=$wait_test tmp_server_http_test=$server_http_test tmp_check_quality=$check_quality tmp_failure_interval=$failure_interval tmp_tries_up=$tries_up tmp_family=$family
local tmp_interval=$interval tmp_interval_tries=$interval_tries tmp_options=$options tmp_type=$type tmp_enabled=$enabled tmp_wait_test=$wait_test tmp_server_http_test=$server_http_test tmp_server_test=$server_test tmp_check_quality=$check_quality tmp_failure_interval=$failure_interval tmp_tries_up=$tries_up tmp_family=$family
uci_validate_section omr-tracker "$1" "$2" \
'hosts:list(host)' \
@ -41,6 +40,7 @@ _validate_section() {
'type:string:undef' \
'enabled:bool:1' \
'server_http_test:bool:0' \
'server_test:bool:0' \
'family:string' \
'options:string'
@ -65,6 +65,7 @@ _validate_section() {
[ -z "$options" ] && options=$tmp_options
[ "$type" = "undef" ] && type=${tmp_type:-ping}
[ -z "$server_http_test" ] && server_http_test=$tmp_server_http_test
[ -z "$server_test" ] && server_test=$tmp_server_test
[ -z "$family" ] && family=$tmp_family
[ -z "$enabled" ] && enabled=$tmp_enabled
}
@ -145,6 +146,7 @@ _launch_tracker() {
procd_append_param env "OMR_TRACKER_PROTO=$proto"
procd_append_param env "OMR_TRACKER_WAIT_TEST=$wait_test"
procd_append_param env "OMR_TRACKER_SERVER_HTTP_TEST=$server_http_test"
procd_append_param env "OMR_TRACKER_SERVER_TEST=$server_test"
procd_set_param limits nofile="51200 51200"
procd_set_param respawn 0 10 0
procd_set_param stderr 1

View file

@ -115,6 +115,13 @@ if [ "$(uci -q get omr-tracker.defaults.server_http_test)" = "" ]; then
EOF
fi
if [ "$(uci -q get omr-tracker.defaults.server_test)" = "" ]; then
uci -q batch <<-EOF >/dev/null
set omr-tracker.defaults.server_test=0
commit omr-tracker
EOF
fi
if [ -z "$(uci -q get omr-tracker.defaults.failure_interval)" ] || [ "$(uci -q get omr-tracker.defaults.failure_interval)" = "5" ]; then
uci -q batch <<-EOF >/dev/null
set omr-tracker.defaults.failure_interval=20

View file

@ -330,7 +330,7 @@ set_route_balancing() {
local multipath_config_route interface_gw interface_if
INTERFACE=$1
[ -z "$INTERFACE" ] && return
[ "$INTERFACE" = "omrvpn" ] && continue
[ "$INTERFACE" = "omrvpn" ] && return
multipath_config_route=$(uci -q get openmptcprouter.$INTERFACE.multipath)
[ -z "$multipath_config_route" ] && multipath_config_route=$(uci -q get network.$INTERFACE.multipath || echo "off")
[ "$(uci -q get openmptcprouter.$INTERFACE.multipathvpn)" = "1" ] && {
@ -390,8 +390,8 @@ set_route_balancing6() {
local multipath_config_route interface_gw interface_if
INTERFACE=$1
[ -z "$INTERFACE" ] && return
[ "$INTERFACE" = "omr6in4" ] && continue
[ "$INTERFACE" = "omrvpn" ] && continue
[ "$INTERFACE" = "omr6in4" ] && return
[ "$INTERFACE" = "omrvpn" ] && return
multipath_config_route=$(uci -q get openmptcprouter.$INTERFACE.multipath)
[ -z "$multipath_config_route" ] && multipath_config_route=$(uci -q get network.$INTERFACE.multipath || echo "off")
[ "$(uci -q get openmptcprouter.$INTERFACE.multipathvpn)" = "1" ] && {

View file

@ -7,18 +7,19 @@ timeout=$(uci -q get openmptcprouter.settings.status_getip_timeout)
[ -z "$timeout" ] && timeout="1"
get_ip_from_server() {
[ -n "$ip" ] && return
serverport=$(uci -q get openmptcprouter.$1.port)
get_ip() {
[ -n "$ip" ] && return
serverip=$1
getip="$(curl -s -k -4 -m ${timeout} --interface $intf https://$serverip:$serverport/clienthost)"
[ -n "$getip" ] && getip=$(echo $getip | jsonfilter -e '@.client_host' | sed 's/::ffff://')
if expr "$getip" : '[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$' >/dev/null; then
ip=$getip
break
return
fi
}
config_list_foreach $1 ip get_ip
[ -n "$ip" ] && break
}
get_ip_from_website() {
@ -30,7 +31,6 @@ get_ip_from_website() {
ipset del ss_rules_dst_bypass_all $checkip > /dev/null 2>&1
if expr "$getip" : '[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$' >/dev/null; then
ip=$getip
break
fi
}

View file

@ -7,17 +7,18 @@ timeout=$(uci -q get openmptcprouter.settings.status_getip_timeout)
[ -z "$timeout" ] && timeout="1"
get_ip_from_server() {
[ -n "$ip" ] && return
serverport=$(uci -q get openmptcprouter.$1.port)
get_ip() {
[ -n "$ip" ] && return
getip="$(curl -s -k -6 -m ${timeout} --interface $intf https://$serverip:$serverport/clienthost)"
[ -n "$getip" ] && getip=$(echo $getip | jsonfilter -e '@.client_host')
if [ -n "$(echo "$getip" | grep :)" ]; then
ip=$getip
break
return
fi
}
config_list_foreach $1 ip get_ip
[ -n "$ip" ] && break
}
get_ip_from_website() {
@ -29,7 +30,6 @@ get_ip_from_website() {
ipset del ss_rules6_dst_bypass_all $checkip > /dev/null 2>&1
if [ -n "$(echo "$getip" | grep :)" ]; then
ip=$getip
break
fi
}

View file

@ -8,8 +8,10 @@ timeout="$(uci -q get openmptcprouter.settings.status_vps_timeout)"
[ -z "$intf" ] && return
get_mptcp_from_server() {
[ -n "$support" ] && return
serverport=$(uci -q get openmptcprouter.$1.port)
get_mptcp() {
[ -n "$support" ] && return
serverip=$1
if [ "$(echo $serverip | grep :)" ]; then
if [ -f /proc/sys/net/mptcp/enabled ]; then
@ -26,11 +28,10 @@ get_mptcp_from_server() {
fi
[ -n "$support" ] && {
support=$(echo $support | jsonfilter -e '@.mptcp')
break
return
}
}
config_list_foreach $1 ip get_mptcp
[ -n "$support" ] && break
}
get_mptcpv0_from_website() {

View file

@ -188,6 +188,9 @@ while [ "$response" = "000" ] && [ "$try" -le 3 ]; do
HOSTLST=$(echo $HOSTLST | tr ' ' '\n' | grep -v "$HOST" | xargs)
fi
try=$((try+1))
if [ "$response" = "000" ]; then
echo "No answer from $HOST, retry..."
fi
done
[ -z "$HOST" ] && HOST="http://speedtest.milkywan.fr/files/10G.iso"

View file

@ -43,6 +43,7 @@ _login() {
if [ -z "$token" ]; then
login_on_server() {
server=$1
[ -n "$token" ] && return
#auth=`curl --max-time 10 -s -k -H "Content-Type: application/json" -X POST -d '{"username":"'$username'","password":"'$password'"}' https://$server:$serverport/login`
resolve="$(resolveip -t 5 $server)"
valid_ip6=$(valid_subnet6 $server)
@ -61,10 +62,10 @@ _login() {
[ -n "$auth" ] && break
done
fi
[ -z "$auth" ] && return
token="$(echo "$auth" | jsonfilter -q -e '@.access_token')"
uci -q set openmptcprouter.${servername}.token="$token"
[ -n "$token" ] && break
[ -n "$auth" ] && {
token="$(echo "$auth" | jsonfilter -q -e '@.access_token')"
uci -q set openmptcprouter.${servername}.token="$token"
}
}
config_load openmptcprouter
config_list_foreach ${servername} ip login_on_server
@ -1717,7 +1718,7 @@ _set_config_from_vps() {
v2ray_key="$(echo "$vps_config" | jsonfilter -q -e '@.v2ray.config.key')"
#v2ray_port="$(echo "$vps_config" | jsonfilter -q -e '@.v2ray.config.port')"
v2ray_port="65228"
if [ -n "$(uci -q get v2ray.omr)" ] && (([ -n "$v2ray_key" ] && [ "$v2ray_key" != "$(uci -q get v2ray.omrout.s_vmess_user_id)" ]) || ([ -n "$v2ray_port" ] && [ "$v2ray_port" != "$(uci -q get v2ray.omrout.s_vmess.port)" ])); then
if [ -n "$(uci -q get v2ray.omr)" ] && ( ([ -n "$v2ray_key" ] && [ "$v2ray_key" != "$(uci -q get v2ray.omrout.s_vmess_user_id)" ]) || ([ -n "$v2ray_port" ] && [ "$v2ray_port" != "$(uci -q get v2ray.omrout.s_vmess.port)" ]) ); then
uci -q batch <<-EOF >/dev/null
set v2ray.omrout.s_socks_user_id="$v2ray_key"
set v2ray.omrout.s_socks_port="$((v2ray_port+3))"
@ -1749,7 +1750,7 @@ _set_config_from_vps() {
xray_vless_reality_key="$(echo "$vps_config" | jsonfilter -q -e '@.xray.config.vless_reality_key')"
#v2ray_port="$(echo "$vps_config" | jsonfilter -q -e '@.v2ray.config.port')"
xray_port="65248"
if [ -n "$(uci -q get xray.omr)" ] && (([ -n "$xray_key" ] && [ "$xray_key" != "$(uci -q get xray.omrout.s_vmess_user_id)" ]) || ([ -n "$xray_port" ] && [ "$xray_port" != "$(uci -q get xray.omrout.s_vmess.port)" ])); then
if [ -n "$(uci -q get xray.omr)" ] && ( ([ -n "$xray_key" ] && [ "$xray_key" != "$(uci -q get xray.omrout.s_vmess_user_id)" ]) || ([ -n "$xray_port" ] && [ "$xray_port" != "$(uci -q get xray.omrout.s_vmess.port)" ]) ); then
uci -q batch <<-EOF >/dev/null
set xray.omrout.s_shadowsocks_port="$((xray_port+4))"
set xray.omrout.s_shadowsocks_password="$xray_sskey"
@ -1785,7 +1786,7 @@ _set_config_from_vps() {
# Glorytun settings
glorytun_key="$(echo "$vps_config" | jsonfilter -q -e '@.glorytun.key')"
glorytun_port="$(echo "$vps_config" | jsonfilter -q -e '@.glorytun.port')"
if [ -n "$(uci -q get glorytun.vpn)" ] && (([ -n "$glorytun_key" ] && [ "$glorytun_key" != "$(uci -q get glorytun.vpn.key)" ]) || ([ -n "$glorytun_port" ] || [ "$glorytun_port" != "$(uci -q get glorytun.vpn.port)" ])); then
if [ -n "$(uci -q get glorytun.vpn)" ] && ( ([ -n "$glorytun_key" ] && [ "$glorytun_key" != "$(uci -q get glorytun.vpn.key)" ]) || ([ -n "$glorytun_port" ] || [ "$glorytun_port" != "$(uci -q get glorytun.vpn.port)" ]) ); then
vpn="$(uci -q get openmptcprouter.settings.vpn)"
glorytun_state=0
if [ "$vpn" = "glorytun_tcp" ]; then
@ -1810,7 +1811,7 @@ _set_config_from_vps() {
/etc/init.d/glorytun restart >/dev/null 2>&1
fi
fi
if [ -n "$(uci -q get glorytun.udp)" ] && (([ -n "$glorytun_key" ] && [ "$glorytun_key" != "$(uci -q get glorytun-udp.vpn.key)" ]) || ([ -n "$glorytun_port" ] || [ "$glorytun_port" != "$(uci -q get glorytun-udp.vpn.port)" ])); then
if [ -n "$(uci -q get glorytun.udp)" ] && ( ([ -n "$glorytun_key" ] && [ "$glorytun_key" != "$(uci -q get glorytun-udp.vpn.key)" ]) || ([ -n "$glorytun_port" ] || [ "$glorytun_port" != "$(uci -q get glorytun-udp.vpn.port)" ]) ); then
vpn="$(uci -q get openmptcprouter.settings.vpn)"
glorytun_state=0
if [ "$vpn" = "glorytun_udp" ]; then
@ -1964,7 +1965,7 @@ _set_config_from_vps() {
# DSVPN settings
dsvpn_key="$(echo "$vps_config" | jsonfilter -q -e '@.dsvpn.key')"
dsvpn_port="$(echo "$vps_config" | jsonfilter -q -e '@.dsvpn.port')"
if [ -f /etc/init.d/dsvpn ] && [ -n "$(uci -q get dsvpn.vpn)" ] && (([ -n "$dsvpn_key" ] && [ "$dsvpn_key" != "$(uci -q get dsvpn.vpn.key)" ]) || ([ -n "$dsvpn_port" ] && [ "$dsvpn_port" != "$(uci -q get dsvpn.vpn.port)" ])); then
if [ -f /etc/init.d/dsvpn ] && [ -n "$(uci -q get dsvpn.vpn)" ] && ( ([ -n "$dsvpn_key" ] && [ "$dsvpn_key" != "$(uci -q get dsvpn.vpn.key)" ]) || ([ -n "$dsvpn_port" ] && [ "$dsvpn_port" != "$(uci -q get dsvpn.vpn.port)" ]) ); then
dsvpn_state=0
if [ "$vpn" = "dsvpn" ]; then
dsvpn_state=1

View file

@ -1,10 +1,9 @@
#!/bin/sh /etc/rc.common
EXTRA_COMMANDS="backup restore"
EXTRA_HELP=<<EOF
backup Backup vnstat database
EXTRA_HELP=" backup Backup vnstat database
restore Restore vnstat database
EOF
"
START=50
STOP=60

View file

@ -2,8 +2,8 @@
. /lib/functions.sh
_setup_macaddr() {
uci -q get "network.$1.macaddr" >/dev/null && return
uci -q set "network.$1.macaddr=$2"
uci -q get "network.${1}.macaddr" >/dev/null && return
uci -q set "network.${1}.macaddr=$2"
}
_setup_macvlan() {
@ -104,11 +104,13 @@ if [ "$(uci -q show network.lan | grep multipath)" != "" ]; then
fi
lanif="eth0"
if [ "$(grep rockchip /etc/os-release)" != "" ]; then
if [ "$(cat /etc/board.json | jsonfilter -q -e '@.model.id' | tr -d '\n')" = "friendlyarm,nanopi-r5c" ]; then
lanif="eth0"
elif [ "$(grep rockchip /etc/os-release)" != "" ]; then
lanif="eth1"
elif [ "$(grep filogic /etc/os-release)" != "" ]; then
lanif="eth1"
elif [ "$(cat /etc/board.json | jsonfilter -q -e '@.model.id' | tr -d '\n')" = "bananapi_bpi-r3" ]; then
elif [ -n "$(cat /etc/board.json | jsonfilter -q -e '@.model.id' | grep bananapi_bpi-r3)" ]; then
lanif="eth0"
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"
@ -196,11 +198,23 @@ set network.lan.delegate=0
set network.lan.addlatency=0
set network.lan.txqueuelen=2000
set dhcp.lan.dhcpv4='server'
set network.lan_dev=device
set network.lan_dev.name=${lanif}
EOF
# Add Lan device if no device defined
if [ -z "$(uci -q show network | grep device)" ]; then
uci -q batch <<-EOF
set network.lan_dev=device
set network.lan_dev.name=${lanif}
EOF
fi
# Delete all bridges
#if [ -n "$(uci -q show network | grep bridge)" ]; then
# for bridge in $(uci -q show network | awk -F. '/bridge/ { print $2}'); do
# uci -q delete network.${bridge}
# done
#fi
uci -q batch <<-EOF
delete network.none
delete network.wan
@ -245,6 +259,11 @@ 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')" = "friendlyarm,nanopi-r5c" ]; then
_setup_wan_interface wan1 eth1 master macvlan
_setup_wan_interface wan2 eth1 on macvlan
_setup_macvlan wan1
_setup_macvlan wan2
elif [ "$(grep rockchip /etc/os-release)" != "" ]; then
_setup_wan_interface wan1 eth0 master macvlan
_setup_wan_interface wan2 eth0 on macvlan

View file

@ -105,4 +105,9 @@ start_service()
log "Enable SIM2 and reboot modem2..."
modem2
fi
}
restart()
{
start_service "@"
}