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-15 19:14:38 +08:00 committed by GitHub
commit bde68e7129
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 349 additions and 120 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, r5c]
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, gl-mt2500, r5c, z8109ax_128m]
OMR_KERNEL: [6.6, 6.12]
runs-on: ubuntu-latest
continue-on-error: true

View file

@ -79,7 +79,7 @@
}
</script>
<% if stderr and #stderr > 0 then %><pre class="error"><%=pcdata(stderr)%></pre><% end %>
<form class="inline" method="post" action="<%=url('admin/system/' .. menuentry:lower() .. '/wizard_add')%>" enctype="multipart/form-data" onkeydown="return event.key != 'Enter';">
<form class="inline" method="post" action="<%=url('admin/system/' .. menuentry:lower() .. '/wizard_add')%>" enctype="multipart/form-data" onkeydown="return event.key != 'Enter';" autocomplete="off">
<div class="cbi-map">
<h2 name="content"><%:Wizard%></h2>
<fieldset class="cbi-section" id="server">

View file

@ -23,7 +23,7 @@ config MODEMMANAGER_WITH_QRTR
config MODEMMANAGER_WITH_AT_COMMAND_VIA_DBUS
bool "Allow AT commands via DBus"
default n
default y
help
Compile ModemManager allowing AT commands without debug flag

View file

@ -25,8 +25,7 @@ start_service() {
procd_open_instance "service"
procd_set_param command /usr/sbin/ModemManager-wrapper
procd_append_param command --log-level="$LOG_LEVEL"
#[ "$LOG_LEVEL" = "DEBUG" ] && procd_append_param command --debug
procd_append_param command --debug
[ "$LOG_LEVEL" = "DEBUG" ] && procd_append_param command --debug
procd_set_param respawn "${respawn_threshold:-3600}" "${respawn_timeout:-5}" "${respawn_retry:-5}"
procd_set_param pidfile "${MODEMMANAGER_PID_FILE}"
procd_close_instance

View file

@ -53,6 +53,15 @@ if [ -f /etc/init.d/dnsmasq ]; then
fi
fi
if [ -f /etc/init.d/dnsmasq ] && [ -z "$(uci -q get dhcp.@dnsmasq[0].server)" ]; then
uci -q batch <<-EOF >/dev/null
add_list dhcp.dnsmasq1.server='127.0.0.1#5353'
add_list dhcp.dnsmasq1.server='/lan/'
add_list dhcp.dnsmasq1.server='/use-application-dns.net/'
commit dhcp
EOF
fi
if [ "$(pgrep openvpn)" = "" ] && [ -f /etc/init.d/openvpn ]; then
openvpn_enable=0
openvpn_enabled() {

View file

@ -118,7 +118,7 @@ _ping_server() {
statusp=$?
if $(exit $statusp); then
serverip_ping=true
return
return 0
fi
fi
}
@ -158,7 +158,7 @@ _httping_server() {
statusp=$?
if $(exit $statusp); then
serverip_ping=true
return
return 0
fi
fi
}
@ -199,7 +199,7 @@ _ping() {
-Q 184 \
"${host}" 2>&1
)
loss=$(echo "$ret" | awk '/packet loss/ {gsub("%","");print $6}' | tr -d '\n')
loss=$(echo "$ret" | awk '/packet loss/ && !/errors/ {gsub("%","");print $6}' | tr -d '\n')
if [ -n "$loss" ] && [ "$loss" != "100" ]; then
if [ "$localip" = "yes" ]; then
@ -210,7 +210,7 @@ _ping() {
}
OMR_TRACKER_LOSS="$loss"
fi
return
return 0
fi
else
ret=$(ping -B -I "${device}" \
@ -223,9 +223,7 @@ _ping() {
)
bindcheck=$(echo "$ret" | grep "Address not available")
[ -n "$bindcheck" ] && OMR_TRACKER_NO_BIND=1
#loss=$(echo "$ret" | grep 'packet loss' | sed -ne 's/.*\([0-9]\+\)% packet loss.*/\1/p')
#loss=$(echo "$ret" | grep 'packet loss' | cut -d " " -f6 | sed 's/%//' | tr -d '\n')
loss=$(echo "$ret" | awk '/packet loss/ {gsub("%","");print $6}' | tr -d '\n')
loss=$(echo "$ret" | awk '/packet loss/ && !/errors/ {gsub("%","");print $6}' | tr -d '\n')
if [ -n "$loss" ] && [ "$loss" != "100" ]; then
if [ "$localip" = "yes" ]; then
#latency=$(echo "$ret" | grep rtt | cut -d "/" -s -f5 | cut -d "." -f1 | tr -d '\n')
@ -236,11 +234,10 @@ _ping() {
}
OMR_TRACKER_LOSS="$loss"
fi
return
return 0
fi
#) && echo "$ret" | grep -sq "bytes from" && {
fi
false
return 1
}
#'
_httping() {
@ -266,7 +263,7 @@ _httping() {
}
OMR_TRACKER_LOSS="$loss"
fi
return
return 0
fi
else
ret=$(httping -l "${host}" \
@ -286,10 +283,10 @@ _httping() {
}
OMR_TRACKER_LOSS="$loss"
fi
return
return 0
fi
fi
false
return 1
}
_dns() {
@ -303,13 +300,13 @@ _dns() {
) && echo "$ret" | grep -sq "1.1.1.1" && {
OMR_TRACKER_LATENCY=$(echo "$ret" | awk '/Query time/{print $4}')
#_update_rto "$OMR_TRACKER_LATENCY"
return
return 0
}
false
return 1
}
_none() {
return
return 0
}
_restart
@ -490,9 +487,6 @@ while true; do
fi
OMR_TRACKER_STATUS_MSG="check error"
fi
else
#OMR_TRACKER_STATUS_MSG=""
OMR_TRACKER_STATUS="OK"
fi
else
#OMR_TRACKER_STATUS_MSG=""
@ -607,9 +601,6 @@ while true; do
fi
OMR_TRACKER_STATUS_MSG="check error"
fi
else
OMR_TRACKER_STATUS_MSG=""
OMR_TRACKER_STATUS="OK"
fi
else
OMR_TRACKER_STATUS_MSG=""

View file

@ -41,4 +41,22 @@ if [ -n "$(grep z8102ax /etc/board.json)" ]; then
EOF
fi
[ -n "$(uci -q changes network)" ] && uci -q commit network
fi
fi
if [ -n "$(grep z8109ax /etc/board.json)" ]; 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'
set network.modem2.device='/sys/devices/platform/soc/11200000.usb/usb1/1-1/1-1.2'
set network.modem3.device='/sys/devices/platform/soc/11200000.usb/usb1/1-1/1-1.3'
set network.modem4.device='/sys/devices/platform/soc/11200000.usb/usb1/1-1/1-1.4'
EOF
elif [ -e /sys/devices/platform/soc/11200000.usb/usb2/2-1/2-1.1 ]; then
uci -q batch <<-EOF
set network.modem1.device='/sys/devices/platform/soc/11200000.usb/usb2/2-1/2-1.1'
set network.modem2.device='/sys/devices/platform/soc/11200000.usb/usb2/2-1/2-1.2'
set network.modem3.device='/sys/devices/platform/soc/11200000.usb/usb2/2-1/2-1.3'
set network.modem4.device='/sys/devices/platform/soc/11200000.usb/usb2/2-1/2-1.4'
EOF
fi
[ -n "$(uci -q changes network)" ] && uci -q commit network
fi

View file

@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (C) 2018-2024 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.
@ -12,6 +12,11 @@ interface_up=$(ifstatus "$OMR_TRACKER_INTERFACE" 2>/dev/null | jsonfilter -q -e
. /usr/share/omr/lib/common-post-tracking.sh
if [ "$OMR_TRACKER_STATUS" = "ERROR" ] && [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.state)" != "down" ]; then
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.state='down'
uci -q commit openmptcprouter
fi
# An interface in error will never be used in MPTCP
if [ "$OMR_TRACKER_STATUS" = "ERROR" ] || { [ "$OMR_TRACKER_INTERFACE" != "omrvpn" ] && [ "$interface_up" != "true" ]; }; then
#interface_autostart=$(ifstatus "$OMR_TRACKER_INTERFACE" 2>/dev/null | jsonfilter -q -e '@["autostart"]')

View file

@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (C) 2018-2024 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.
@ -48,6 +48,12 @@ default_gw6=$(ip -6 route get 2606:4700:4700::1111 | grep via | awk '{print $3}'
initcwrwnd=""
interface_up=$(ifstatus "$OMR_TRACKER_INTERFACE" 2>/dev/null | jsonfilter -q -e '@["up"]')
if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.state)" != "up" ]; then
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.state='up'
uci -q commit openmptcprouter
fi
if [ "$OMR_TRACKER_INTERFACE" = "glorytun" ] || [ "$OMR_TRACKER_INTERFACE" = "omrvpn" ] || [ "$OMR_TRACKER_INTERFACE" = "omr6in4" ]; then
if [ "$OMR_TRACKER_INTERFACE" = "omrvpn" ]; then
uci -q set openmptcprouter.omr.vpn='up'

View file

@ -814,7 +814,7 @@ function interfaces_status()
local timeout = uci:get("openmptcprouter","settings","status_getip_timeout") or "1"
local dns_test = ""
if uci:get("openmptcprouter","settings","external_check") ~= "0" then
dns_test = sys.exec("dig +timeout=" .. timeout .. " +tries=1 openmptcprouter.com | grep 'ANSWER: 0'")
dns_test = sys.exec("dig +timeout=" .. timeout .. " +tries=1 openmptcprouter.com | grep -e 'ANSWER: 0' -e 'no servers could be reached'")
end
if dns_test == "" then
mArray.openmptcprouter["dns"] = true

View file

@ -95,7 +95,7 @@ MY_DEPENDS := \
!(LINUX_5_4||LINUX_6_1||TARGET_ramips||TARGET_ipq806x):mptcp-bpf-minrtt !(LINUX_5_4||LINUX_6_1||TARGET_ramips||TARGET_ipq806x):mptcp-bpf-bkup !(LINUX_5_4||LINUX_6_1||TARGET_ramips||TARGET_ipq806x):mptcp-bpf-burst !(LINUX_5_4||LINUX_6_1||TARGET_ramips||TARGET_ipq806x):mptcp-bpf-first !(LINUX_5_4||LINUX_6_1||TARGET_ramips||TARGET_ipq806x):mptcp-bpf-red !(LINUX_5_4||LINUX_6_1||TARGET_ramips||TARGET_ipq806x):mptcp-bpf-rr !(LINUX_5_4||LINUX_6_1||TARGET_ramips||TARGET_ipq806x):bpftool-full \
kmod-ovpn-dco-v2 lspci \
TARGET_mediatek_filogic:kmod-mt7915-firmware TARGET_mediatek_filogic:kmod-mt7916-firmware TARGET_mediatek_filogic:kmod-mt7986-firmware TARGET_mediatek_filogic:kmod-mt7986-wo-firmware TARGET_mediatek_filogic:kmod-mt7996-firmware TARGET_mediatek_filogic:kmod-mt7996-233-firmware TARGET_mediatek_filogic:mt7988-wo-firmware TARGET_mediatek_filogic:mt7988-2p5g-phy-firmware \
luci-app-smartdns
luci-app-smartdns logd
# !TARGET_ipq40xx:kmod-rt2800-usb (TARGET_x86||TARGET_x86_64):kmod-iwlwifi (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl1000 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl100 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl105 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl135 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl2000 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl2030 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl3160 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl3168 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl5000 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl5150 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl6000g2 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl6000g2a (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl6000g2b (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl6050 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl7260 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl7265 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl7265d (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl8260c (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl8265 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-ax201 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-ax200 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-ax210 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-ax101 \
# !TARGET_ipq40xx:kmod-rtl8xxxu !TARGET_ipq40xx:kmod-rtl8192cu !TARGET_ipq40xx:kmod-net-rtl8192su !LINUX_6_1:kmod-rtl8812au-ct (TARGET_x86||TARGET_x86_64):kmod-r8169 (TARGET_x86||TARGET_x86_64):kmod-8139too (TARGET_x86||TARGET_x86_64):kmod-r8125 !TARGET_ipq40xx:kmod-rtl8187 kmod-rtl8xxxu (TARGET_x86||TARGET_x86_64):rtl8192eu-firmware

View file

@ -1,17 +1,45 @@
#!/bin/sh
SERVER=$1
shift
[ -z "$SERVER" ] && SERVER="vps"
KEY=$(uci -q get iperf.$SERVER.key)
USER=$(uci -q get iperf.$SERVER.user)
PASSWORD=$(uci -q get iperf.$SERVER.password)
HOST=$(uci -q get iperf.$SERVER.host)
PORTS=$(uci -q get iperf.$SERVER.ports | sed 's/,/ /g')
PORT="${PORTS%% *}"
echo $KEY | base64 -d > /tmp/iperf.pem
#
# 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.
#
. /lib/functions.sh
get_auth_data() {
SERVER="$1"
config_get current $SERVER current
if [ "$current" = "1" ]; then
KEY=$(uci -q get iperf.$SERVER.key)
USER=$(uci -q get iperf.$SERVER.user)
PASSWORD=$(uci -q get iperf.$SERVER.password)
HOST=$(uci -q get iperf.$SERVER.host)
PORTS=$(uci -q get iperf.$SERVER.ports | sed 's/,/ /g')
PORT="${PORTS%% *}"
fi
}
config_load openmptcprouter
config_foreach get_auth_data server
if [ -n "$PASSWORD" ] && [ -n "$USER" ] && [ -n "$KEY" ]; then
echo $KEY | base64 -d > /tmp/iperf.pem
#IPERF3_PASSWORD=$PASSWORD iperf3 --username $USER --rsa-public-key-path /tmp/iperf.pem --use-pkcs1-padding -c $HOST -p $PORT ${@}
IPERF3_PASSWORD=$PASSWORD iperf3 --username $USER --rsa-public-key-path /tmp/iperf.pem -c $HOST -p $PORT ${@}
echo "machin: $0"
case "$0" in
*proxy)
IPERF3_PASSWORD=$PASSWORD iperf3 --username $USER --rsa-public-key-path /tmp/iperf.pem -c $HOST -p $PORT --socks5 127.0.0.1:1111 ${@}
;;
*vpn)
VPNIP=$(ip r show default metric 0 | awk '{ print $3 }' | tr -d '\n')
IPERF3_PASSWORD=$PASSWORD iperf3 --username $USER --rsa-public-key-path /tmp/iperf.pem -c $VPNIP -p $PORT
;;
*)
IPERF3_PASSWORD=$PASSWORD iperf3 --username $USER --rsa-public-key-path /tmp/iperf.pem -c $HOST -p $PORT ${@}
;;
esac
else
iperf3 -c $HOST -p $PORT ${@}
fi

View file

@ -0,0 +1 @@
omr-iperf

View file

@ -0,0 +1 @@
omr-iperf

View file

@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (C) 2018-2024 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.
@ -30,8 +30,8 @@ fi
exit 0
}
HOSTLST="http://scaleway.testdebit.info/10G.iso http://bordeaux.testdebit.info/10G.iso http://aix-marseille.testdebit.info/10G.iso http://lyon.testdebit.info/10G.iso http://lille.testdebit.info/10G.iso http://paris.testdebit.info/10G.iso http://appliwave.testdebit.info/10G/10G.iso http://speedtest.frankfurt.linode.com/garbage.php?ckSize=10000 http://speedtest.tokyo2.linode.com/garbage.php?ckSize=10000 http://speedtest.singapore.linode.com/garbage.php?ckSize=10000 http://speedtest.newark.linode.com/garbage.php?ckSize=10000 http://speedtest.atlanta.linode.com/garbage.php?ckSize=10000 http://speedtest.dallas.linode.com/garbage.php?ckSize=10000 http://speedtest.fremont.linode.com/garbage.php?ckSize=10000 http://ipv4.bouygues.testdebit.info/10G.iso http://par.download.datapacket.com/10000mb.bin http://nyc.download.datapacket.com/10000mb.bin http://ams.download.datapacket.com/10000mb.bin http://fra.download.datapacket.com/10000mb.bin http://lon.download.datapacket.com/10000mb.bin http://mad.download.datapacket.com/10000mb.bin http://prg.download.datapacket.com/10000mb.bin http://sto.download.datapacket.com/10000mb.bin http://vie.download.datapacket.com/10000mb.bin http://war.download.datapacket.com/10000mb.bin http://atl.download.datapacket.com/10000mb.bin http://chi.download.datapacket.com/10000mb.bin http://lax.download.datapacket.com/10000mb.bin http://mia.download.datapacket.com/10000mb.bin http://nyc.download.datapacket.com/10000mb.bin http://speedtest.milkywan.fr/files/10G.iso"
HOSTLST6="http://scaleway.testdebit.info/10G.iso http://bordeaux.testdebit.info/10G.iso http://aix-marseille.testdebit.info/10G.iso http://lyon.testdebit.info/10G.iso http://lille.testdebit.info/10G.iso http://paris.testdebit.info/10G.iso http://appliwave.testdebit.info/10G/10G.iso http://speedtest.frankfurt.linode.com/garbage.php?ckSize=10000 http://speedtest.tokyo2.linode.com/garbage.php?ckSize=10000 http://speedtest.singapore.linode.com/garbage.php?ckSize=10000 http://speedtest.newark.linode.com/garbage.php?ckSize=10000 http://speedtest.atlanta.linode.com/garbage.php?ckSize=10000 http://speedtest.dallas.linode.com/garbage.php?ckSize=10000 http://speedtest.fremont.linode.com/garbage.php?ckSize=10000 http://ipv6.bouygues.testdebit.info/10G.iso http://par.download.datapacket.com/10000mb.bin http://nyc.download.datapacket.com/10000mb.bin http://ams.download.datapacket.com/10000mb.bin http://fra.download.datapacket.com/10000mb.bin http://lon.download.datapacket.com/10000mb.bin http://mad.download.datapacket.com/10000mb.bin http://prg.download.datapacket.com/10000mb.bin http://sto.download.datapacket.com/10000mb.bin http://vie.download.datapacket.com/10000mb.bin http://war.download.datapacket.com/10000mb.bin http://atl.download.datapacket.com/10000mb.bin http://chi.download.datapacket.com/10000mb.bin http://lax.download.datapacket.com/10000mb.bin http://mia.download.datapacket.com/10000mb.bin http://nyc.download.datapacket.com/10000mb.bin http://speedtest.milkywan.fr/files/10G.iso"
HOSTLST="http://scaleway.testdebit.info/10G.iso http://bordeaux.testdebit.info/10G.iso http://aix-marseille.testdebit.info/10G.iso http://lyon.testdebit.info/10G.iso http://lille.testdebit.info/10G.iso http://paris.testdebit.info/10G.iso http://appliwave.testdebit.info/10G/10G.iso http://speedtest.frankfurt.linode.com/garbage.php?ckSize=10000 http://speedtest.tokyo2.linode.com/garbage.php?ckSize=10000 http://speedtest.singapore.linode.com/garbage.php?ckSize=10000 http://speedtest.newark.linode.com/garbage.php?ckSize=10000 http://speedtest.atlanta.linode.com/garbage.php?ckSize=10000 http://speedtest.dallas.linode.com/garbage.php?ckSize=10000 http://speedtest.fremont.linode.com/garbage.php?ckSize=10000 http://ipv4.bouygues.testdebit.info/10G.iso http://par.download.datapacket.com/10000mb.bin http://nyc.download.datapacket.com/10000mb.bin http://ams.download.datapacket.com/10000mb.bin http://fra.download.datapacket.com/10000mb.bin http://lon.download.datapacket.com/10000mb.bin http://mad.download.datapacket.com/10000mb.bin http://prg.download.datapacket.com/10000mb.bin http://sto.download.datapacket.com/10000mb.bin http://vie.download.datapacket.com/10000mb.bin http://war.download.datapacket.com/10000mb.bin http://atl.download.datapacket.com/10000mb.bin http://chi.download.datapacket.com/10000mb.bin http://lax.download.datapacket.com/10000mb.bin http://mia.download.datapacket.com/10000mb.bin http://nyc.download.datapacket.com/10000mb.bin http://speedtest.milkywan.fr/files/10G.iso https://rbx.proof.ovh.net/files/10Gb.dat https://gra.proof.ovh.net/files/10Gb.dat https://sbg.proof.ovh.net/files/10Gb.dat https://bhs.proof.ovh.ca/files/10Gb.dat https://vin.proof.ovh.us/files/10Gb.dat https://hil.proof.ovh.us/files/10Gb.dat http://speedtest.tele2.net/10GB.zip https://la.speedtest.clouvider.net/10g.bin https://atl.speedtest.clouvider.net/10g.bin https://nyc.speedtest.clouvider.net/10g.bin https://lon.speedtest.clouvider.net/10g.bin https://man.speedtest.clouvider.net/10g.bin https://ams.speedtest.clouvider.net/10g.bin https://fra.speedtest.clouvider.net/10g.bin https://dal.speedtest.clouvider.net/10g.bin https://ash.speedtest.clouvider.net/10g.bin https://phx.speedtest.clouvider.net/10g.bin https://chi.speedtest.clouvider.net/10g.bin"
HOSTLST6="http://scaleway.testdebit.info/10G.iso http://bordeaux.testdebit.info/10G.iso http://aix-marseille.testdebit.info/10G.iso http://lyon.testdebit.info/10G.iso http://lille.testdebit.info/10G.iso http://paris.testdebit.info/10G.iso http://appliwave.testdebit.info/10G/10G.iso http://speedtest.frankfurt.linode.com/garbage.php?ckSize=10000 http://speedtest.tokyo2.linode.com/garbage.php?ckSize=10000 http://speedtest.singapore.linode.com/garbage.php?ckSize=10000 http://speedtest.newark.linode.com/garbage.php?ckSize=10000 http://speedtest.atlanta.linode.com/garbage.php?ckSize=10000 http://speedtest.dallas.linode.com/garbage.php?ckSize=10000 http://speedtest.fremont.linode.com/garbage.php?ckSize=10000 http://ipv6.bouygues.testdebit.info/10G.iso http://par.download.datapacket.com/10000mb.bin http://nyc.download.datapacket.com/10000mb.bin http://ams.download.datapacket.com/10000mb.bin http://fra.download.datapacket.com/10000mb.bin http://lon.download.datapacket.com/10000mb.bin http://mad.download.datapacket.com/10000mb.bin http://prg.download.datapacket.com/10000mb.bin http://sto.download.datapacket.com/10000mb.bin http://vie.download.datapacket.com/10000mb.bin http://war.download.datapacket.com/10000mb.bin http://atl.download.datapacket.com/10000mb.bin http://chi.download.datapacket.com/10000mb.bin http://lax.download.datapacket.com/10000mb.bin http://mia.download.datapacket.com/10000mb.bin http://nyc.download.datapacket.com/10000mb.bin http://speedtest.milkywan.fr/files/10G.iso https://rbx.proof.ovh.net/files/10Gb.dat https://gra.proof.ovh.net/files/10Gb.dat https://sbg.proof.ovh.net/files/10Gb.dat https://bhs.proof.ovh.ca/files/10Gb.dat https://vin.proof.ovh.us/files/10Gb.dat https://hil.proof.ovh.us/files/10Gb.dat http://speedtest.tele2.net/10GB.zip https://la.speedtest.clouvider.net/10g.bin https://atl.speedtest.clouvider.net/10g.bin https://nyc.speedtest.clouvider.net/10g.bin https://lon.speedtest.clouvider.net/10g.bin https://man.speedtest.clouvider.net/10g.bin https://ams.speedtest.clouvider.net/10g.bin https://fra.speedtest.clouvider.net/10g.bin https://dal.speedtest.clouvider.net/10g.bin https://ash.speedtest.clouvider.net/10g.bin https://phx.speedtest.clouvider.net/10g.bin https://chi.speedtest.clouvider.net/10g.bin"
select_server() {
[ "$FASTTEST" = true ] || echo "Select best test server..."
@ -188,7 +188,7 @@ while [ "$response" = "000" ] && [ "$try" -le 3 ]; do
HOSTLST=$(echo $HOSTLST | tr ' ' '\n' | grep -v "$HOST" | xargs)
fi
try=$((try+1))
if [ "$response" = "000" ]; then
if [ "$response" = "000" ] && [ "$FASTTEST" != true ]; then
echo "No answer from $HOST, retry..."
fi
done

View file

@ -530,6 +530,75 @@ if [ "$board" = "z8102ax-128m" ] || [ "$board" = "z8102ax-64m" ] || [ "$board" =
commit firewall
EOF
fi
if [ "$board" = "z8109ax-128m" ] || [ "$board" = "z8109ax-512" ] || [ "$board" = "z8109ax" ]; then
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.peerdns='0'
set network.modem1.delegate='0'
set network.modem1.multipath='on'
set network.modem1.defaultroute='0'
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.peerdns='0'
set network.modem2.delegate='0'
set network.modem2.multipath='on'
set network.modem2.defaultroute='0'
set network.modem3=interface
set network.modem3.proto='modemmanager'
set network.modem3.apn=''
set network.modem3.auth='none'
set network.modem3.iptype='ipv4v6'
set network.modem3.addlatency='0'
set network.modem3.force_link='1'
set network.modem3.peerdns='0'
set network.modem3.delegate='0'
set network.modem3.multipath='on'
set network.modem3.defaultroute='0'
set network.modem4=interface
set network.modem4.proto='modemmanager'
set network.modem4.apn=''
set network.modem4.auth='none'
set network.modem4.iptype='ipv4v6'
set network.modem4.addlatency='0'
set network.modem4.force_link='1'
set network.modem4.peerdns='0'
set network.modem4.delegate='0'
set network.modem4.multipath='on'
set network.modem4.defaultroute='0'
set network.modem1.device='/sys/devices/platform/soc/11200000.usb/usb1/1-1/1-1.1'
set network.modem2.device='/sys/devices/platform/soc/11200000.usb/usb1/1-1/1-1.2'
set network.modem3.device='/sys/devices/platform/soc/11200000.usb/usb1/1-1/1-1.3'
set network.modem4.device='/sys/devices/platform/soc/11200000.usb/usb1/1-1/1-1.4'
EOF
if [ -e /sys/devices/platform/soc/11200000.usb/usb2/2-1/2-1.1 ]; then
uci -q batch <<-EOF
set network.modem1.device='/sys/devices/platform/soc/11200000.usb/usb2/2-1/2-1.1'
set network.modem2.device='/sys/devices/platform/soc/11200000.usb/usb2/2-1/2-1.2'
set network.modem3.device='/sys/devices/platform/soc/11200000.usb/usb2/2-1/2-1.3'
set network.modem4.device='/sys/devices/platform/soc/11200000.usb/usb2/2-1/2-1.4'
EOF
fi
uci -q batch <<-EOF
commit network
add_list firewall.@zone[1].network='modem1'
add_list firewall.@zone[1].network='modem2'
add_list firewall.@zone[1].network='modem3'
add_list firewall.@zone[1].network='modem4'
commit firewall
EOF
fi
# set network.lan.ipaddr='192.168.5.10'
# set network.lan.gateway='192.168.5.1'

View file

@ -0,0 +1,134 @@
#!/bin/sh
[ -n "$(uci -q get smartdns.@smartdns[0])" ] || exit 0
uci -q set smartdns.@smartdns[0].port='5355'
uci -q set smartdns.@smartdns[0].auto_set_dnsmasq='1'
if [ -z "$(uci -q get smartdns.@server[0])" ]; then
uci -q batch <<-EOF >/dev/null
set smartdns.@smartdns[0].enabled='1'
add smartdns server
set smartdns.@server[-1].enabled='1'
set smartdns.@server[-1].name='Cloudfare'
set smartdns.@server[-1].ip='1.1.1.1'
set smartdns.@server[-1].type='udp'
set smartdns.@server[-1].server_group='public'
add smartdns server
set smartdns.@server[-1].enabled='1'
set smartdns.@server[-1].name='Cloudfare'
set smartdns.@server[-1].ip='1.0.0.1'
set smartdns.@server[-1].type='udp'
set smartdns.@server[-1].server_group='public'
add smartdns server
set smartdns.@server[-1].enabled='1'
set smartdns.@server[-1].name='Cloudfare'
set smartdns.@server[-1].ip='2606:4700:4700::1111'
set smartdns.@server[-1].type='udp'
set smartdns.@server[-1].server_group='public'
add smartdns server
set smartdns.@server[-1].enabled='1'
set smartdns.@server[-1].name='Cloudfare'
set smartdns.@server[-1].ip='2606:4700:4700::1001'
set smartdns.@server[-1].type='udp'
set smartdns.@server[-1].server_group='public'
add smartdns server
set smartdns.@server[-1].enabled='1'
set smartdns.@server[-1].name='Google'
set smartdns.@server[-1].ip='8.8.8.8'
set smartdns.@server[-1].type='udp'
set smartdns.@server[-1].server_group='public'
add smartdns server
set smartdns.@server[-1].enabled='1'
set smartdns.@server[-1].name='Google'
set smartdns.@server[-1].ip='8.8.4.4'
set smartdns.@server[-1].type='udp'
set smartdns.@server[-1].server_group='public'
add smartdns server
set smartdns.@server[-1].enabled='1'
set smartdns.@server[-1].name='Google'
set smartdns.@server[-1].ip='2001:4860:4860::8888'
set smartdns.@server[-1].type='udp'
set smartdns.@server[-1].server_group='public'
add smartdns server
set smartdns.@server[-1].enabled='1'
set smartdns.@server[-1].name='Google'
set smartdns.@server[-1].ip='2001:4860:4860::8844'
set smartdns.@server[-1].type='udp'
set smartdns.@server[-1].server_group='public'
add smartdns server
set smartdns.@server[-1].enabled='1'
set smartdns.@server[-1].name='quad9'
set smartdns.@server[-1].ip='9.9.9.9'
set smartdns.@server[-1].type='udp'
set smartdns.@server[-1].server_group='public'
add smartdns server
set smartdns.@server[-1].enabled='1'
set smartdns.@server[-1].name='quad9'
set smartdns.@server[-1].ip='149.112.112.112'
set smartdns.@server[-1].type='udp'
set smartdns.@server[-1].server_group='public'
add smartdns server
set smartdns.@server[-1].enabled='1'
set smartdns.@server[-1].name='quad9'
set smartdns.@server[-1].ip='2620:fe::fe'
set smartdns.@server[-1].type='udp'
set smartdns.@server[-1].server_group='public'
add smartdns server
set smartdns.@server[-1].enabled='1'
set smartdns.@server[-1].name='quad9'
set smartdns.@server[-1].ip='2620:fe::9'
set smartdns.@server[-1].type='udp'
set smartdns.@server[-1].server_group='public'
add smartdns server
set smartdns.@server[-1].enabled='1'
set smartdns.@server[-1].name='quad9'
set smartdns.@server[-1].ip='https://dns.quad9.net/dns-query'
set smartdns.@server[-1].type='https'
set smartdns.@server[-1].server_group='public'
add smartdns server
set smartdns.@server[-1].enabled='1'
set smartdns.@server[-1].name='quad9'
set smartdns.@server[-1].ip='tls://dns.quad9.net'
set smartdns.@server[-1].type='tls'
set smartdns.@server[-1].server_group='public'
add smartdns server
set smartdns.@server[-1].enabled='1'
set smartdns.@server[-1].name='114dns'
set smartdns.@server[-1].ip='114.114.114.114'
set smartdns.@server[-1].type='udp'
set smartdns.@server[-1].server_group='public'
add smartdns server
set smartdns.@server[-1].enabled='1'
set smartdns.@server[-1].name='114dns'
set smartdns.@server[-1].ip='114.114.115.115'
set smartdns.@server[-1].type='udp'
set smartdns.@server[-1].server_group='public'
add smartdns server
set smartdns.@server[-1].enabled='1'
set smartdns.@server[-1].name='DNS.WATCH'
set smartdns.@server[-1].ip='84.200.69.80'
set smartdns.@server[-1].type='udp'
set smartdns.@server[-1].server_group='public'
add smartdns server
set smartdns.@server[-1].enabled='1'
set smartdns.@server[-1].name='DNS.WATCH'
set smartdns.@server[-1].ip='84.200.70.40'
set smartdns.@server[-1].type='udp'
set smartdns.@server[-1].server_group='public'
add smartdns server
set smartdns.@server[-1].enabled='1'
set smartdns.@server[-1].name='DNS.WATCH'
set smartdns.@server[-1].ip='2001:1608:10:25::1c04:b12f'
set smartdns.@server[-1].type='udp'
set smartdns.@server[-1].server_group='public'
add smartdns server
set smartdns.@server[-1].enabled='1'
set smartdns.@server[-1].name='DNS.WATCH'
set smartdns.@server[-1].ip='2001:1608:10:25::9249:d69b'
set smartdns.@server[-1].type='udp'
set smartdns.@server[-1].server_group='public'
EOF
fi
uci -q commit smartdns
exit 0

View file

@ -72,6 +72,8 @@ if (proto == "tcp") {
chain ss_rules_pre_{{ proto }} {
type {{ type }} hook {{ hook }} priority {{ priority }};
ip daddr @ss_rules_remote_servers accept;
ip6 daddr @ss_rules6_remote_servers accept;
meta l4proto {{ proto }}{%- let ifnames=get_ifnames(); if (length(ifnames)): %} iifname { {{join(", ", ifnames)}} }{% endif %} goto ss_rules_pre_src_{{ proto }};
}

View file

@ -72,6 +72,8 @@ if (proto == "tcp") {
chain ss_rules_pre_{{ proto }} {
type {{ type }} hook {{ hook }} priority {{ priority }};
ip daddr @ss_rules_remote_servers accept;
ip6 daddr @ss_rules6_remote_servers accept;
meta l4proto {{ proto }}{%- let ifnames=get_ifnames(); if (length(ifnames)): %} iifname { {{join(", ", ifnames)}} }{% endif %} goto ss_rules_pre_src_{{ proto }};
}

View file

@ -72,6 +72,8 @@ if (proto == "tcp") {
chain v2r_rules_pre_{{ proto }} {
type {{ type }} hook {{ hook }} priority {{ priority }};
ip daddr @v2r_rules_remote_servers accept;
ip6 daddr @v2r_rules6_remote_servers accept;
meta l4proto {{ proto }}{%- let ifnames=get_ifnames(); if (length(ifnames)): %} iifname { {{join(", ", ifnames)}} }{% endif %} goto v2r_rules_pre_src_{{ proto }};
}

View file

@ -72,6 +72,8 @@ if (proto == "tcp") {
chain xr_rules_pre_{{ proto }} {
type {{ type }} hook {{ hook }} priority {{ priority }};
ip daddr @xr_rules_remote_servers accept;
ip6 daddr @xr_rules6_remote_servers accept;
meta l4proto {{ proto }}{%- let ifnames=get_ifnames(); if (length(ifnames)): %} iifname { {{join(", ", ifnames)}} }{% endif %} goto xr_rules_pre_src_{{ proto }};
}

View file

@ -9,85 +9,35 @@ log() {
logger -t "z8102" "$@"
}
modem1()
modem_reset()
{
# sim 1
#i=461
#echo $i > /sys/class/gpio/export
#echo "out" > /sys/class/gpio/gpio${i}/direction
#echo "0" > /sys/class/gpio/gpio${i}/value
if [ -e /sys/class/gpio/sim1/value ]; then
echo "0" > /sys/class/gpio/sim1/value
modemnb=$1
# sim
if [ -e /sys/class/gpio/sim${modemnb}/value ]; then
echo "0" > /sys/class/gpio/sim${modemnb}/value
elif [ -f /usr/bin/gpiofind ]; then
gpioset `gpiofind "sim1"`=0
gpioset `gpiofind "sim=${modemnb}"`=0
else
gpioset -t0 sim1=0
gpioset -t0 sim${modemnb}=0
fi
# stop modem 1
#i=459
#echo $i > /sys/class/gpio/export
#echo "out" > /sys/class/gpio/gpio${i}/direction
#echo "0" > /sys/class/gpio/gpio${i}/value
if [ -e /sys/class/gpio/modem1/value ]; then
echo "0" > /sys/class/gpio/modem1/value
# stop modem
if [ -e /sys/class/gpio/modem${modemnb}/value ]; then
echo "0" > /sys/class/gpio/modem${modemnb}/value
elif [ -f /usr/bin/gpiofind ]; then
gpioset `gpiofind "modem1"`=0
gpioset `gpiofind "modem${modemnb}"`=0
else
gpioset -t0 modem1=0
gpioset -t0 modem${modemnb}=0
fi
sleep 1
# run modem 1
#i=459
#echo "1" > /sys/class/gpio/gpio${i}/value
if [ -e /sys/class/gpio/modem1/value ]; then
echo "1" > /sys/class/gpio/modem1/value
# run modem
if [ -e /sys/class/gpio/modem${modemnb}/value ]; then
echo "1" > /sys/class/gpio/modem${modemnb}/value
elif [ -f /usr/bin/gpiofind ]; then
gpioset `gpiofind "modem1"`=1
gpioset `gpiofind "modem${modemnb}"`=1
else
gpioset -t0 modem1=1
fi
}
modem2()
{
# sim 2
#i=462
#echo $i > /sys/class/gpio/export
#echo "out" > /sys/class/gpio/gpio${i}/direction
#echo "0" > /sys/class/gpio/gpio${i}/value
if [ -e /sys/class/gpio/sim2/value ]; then
echo "0" > /sys/class/gpio/sim2/value
elif [ -f /usr/bin/gpiofind ]; then
gpioset `gpiofind "sim2"`=0
else
gpioset -t0 sim2=0
fi
# stop modem 2
#i=460
#echo $i > /sys/class/gpio/export
#echo "out" > /sys/class/gpio/gpio${i}/direction
#echo "0" > /sys/class/gpio/gpio${i}/value
if [ -e /sys/class/gpio/modem2/value ]; then
echo "0" > /sys/class/gpio/modem2/value
elif [ -f /usr/bin/gpiofind ]; then
gpioset `gpiofind "modem2"`=0
else
gpioset -t0 modem2=0
fi
sleep 1
# run modem 2
#i=460
#echo "1" > /sys/class/gpio/gpio${i}/value
if [ -e /sys/class/gpio/modem2/value ]; then
echo "1" > /sys/class/gpio/modem2/value
elif [ -f /usr/bin/gpiofind ]; then
gpioset `gpiofind "modem2"`=1
else
gpioset -t0 modem2=1
gpioset -t0 modem${modemnb}=1
fi
}
@ -96,18 +46,28 @@ start_service()
modem="$1"
if [ -z "$modem" ]; then
log "Enable SIMs and reboot modems..."
modem1
modem2
modem_reset 1
modem_reset 2
if [ -n "$(cat /etc/board.json | grep z8109)" ]; then
modem_reset 3
modem_reset 4
fi
elif [ "$modem" = "modem1" ]; then
log "Enable SIM1 and reboot modem1..."
modem1
modem_reset 1
elif [ "$modem" = "modem2" ]; then
log "Enable SIM2 and reboot modem2..."
modem2
modem_reset 2
elif [ "$modem" = "modem3" ]; then
log "Enable SIM3 and reboot modem3..."
modem_reset 3
elif [ "$modem" = "modem4" ]; then
log "Enable SIM4 and reboot modem4..."
modem_reset 4
fi
}
restart()
{
start_service "@"
}
start_service "$@"
}