1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-15 03:51:51 +00:00
This commit is contained in:
suyuan 2024-05-03 22:56:43 +08:00 committed by GitHub
commit 964b18466e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 52 additions and 19 deletions

View file

@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libmbim
PKG_SOURCE_VERSION:=1.31.2-dev
PKG_SOURCE_VERSION:=1.31.3-dev
#PKG_SOURCE_VERSION:=1.30.0
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/libmbim.git
#PKG_MIRROR_HASH:=8fc4e2d78d6a1003bf89303d3ce779283b176d74e84a241ba8efb0d468605268
#libmPKG_MIRROR_HASH:=8fc4e2d78d6a1003bf89303d3ce779283b176d74e84a241ba8efb0d468605268
PKG_BUILD_FLAGS:=gc-sections

View file

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=libqmi
#PKG_SOURCE_VERSION:=1.34.0
PKG_SOURCE_VERSION:=1.35.2-dev
PKG_SOURCE_VERSION:=1.35.3-dev
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git

View file

@ -35,6 +35,13 @@ return view.extend({
.map(function(s) { return s['.name']; });
};
s.handleAdd = function(ev) {
this.sectiontype = 'interface';
var promise = form.GridSection.prototype.handleAdd.apply(this, arguments);
this.sectiontype = undefined;
return promise;
};
o = s.option(form.Flag, 'enabled', _('Enabled'));
o.default = false;
@ -54,13 +61,13 @@ return view.extend({
o = s.option(form.DynamicList, 'hosts', _('Tracking hostname or IP address'),
_('This hostname or IP address will be pinged to determine if the link is up or down. Leave blank to use defaults settings.'));
o.datatype = 'hosts';
//o.datatype = 'hosts';
o.modalonly = true;
o.rmempty = false;
o = s.option(form.DynamicList, 'hosts6', _('Tracking hostname or IP address for IPv6'),
_('This hostname or IP address will be pinged to determine if the link is up or down. Leave blank to use defaults settings.'));
o.datatype = 'hosts';
//o.datatype = 'hosts';
o.modalonly = true;
o.depends('family', 'ipv4ipv6');
o.depends('family', 'ipv6');

View file

@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=modemmanager
PKG_SOURCE_VERSION:=1.23.5-dev
PKG_SOURCE_VERSION:=1.23.6-dev
PKG_RELEASE:=20
PKG_SOURCE_PROTO:=git

View file

@ -24,7 +24,8 @@ 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
#[ "$LOG_LEVEL" = "DEBUG" ] && procd_append_param command --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

@ -734,14 +734,15 @@ if [ "$OMR_TRACKER_STATUS" = "ERROR" ] || ([ "$OMR_TRACKER_INTERFACE" != "omrvpn
interface_error=$(ifstatus "$OMR_TRACKER_INTERFACE" 2>/dev/null | jsonfilter -q -e '@["errors"][0].code')
#if [ "$interface_available" = "true" ] && [ -n "$OMR_TRACKER_INTERFACE" ] && ([ "$(uci -q get network.$OMR_TRACKER_INTERFACE.proto)" = "modemmanager" ] || [ "$(uci -q get network.$OMR_TRACKER_INTERFACE.proto)" = "wireguard" ]) && [ "$interface_error" != "MM_PINCODE_REQUIRED" ] && [ "$interface_error" != "MM_FAILED_REASON_SIM_MISSING" ]; then
# _log "No answer from $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE), restart interface"
# _log "Set $OMR_TRACKER_INTERFACE down"
# ifdown $OMR_TRACKER_INTERFACE
# sleep 5
# _log "Set $OMR_TRACKER_INTERFACE up"
# ifup $OMR_TRACKER_INTERFACE
# sleep 30
if [ -n "$OMR_TRACKER_INTERFACE" ] && [ -n "$OMR_TRACKER_DEVICE" ] && [ "$(uci -q get network.$OMR_TRACKER_INTERFACE.proto)" = "modemmanager" ] && [ "$interface_up" = "false" ] && [ "$interface_available" = "false" ] && [ "$interface_pending" = "false" ] && [ "$interface_autostart" = "true" ]; then
if [ "$interface_available" = "true" ] && [ "$interface_up" = "false" ] && [ -n "$OMR_TRACKER_INTERFACE" ] && ([ "$(uci -q get network.$OMR_TRACKER_INTERFACE.proto)" = "modemmanager" ] || [ "$(uci -q get network.$OMR_TRACKER_INTERFACE.proto)" = "wireguard" ]); then
_log "No answer from $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE), restart interface"
_log "Set $OMR_TRACKER_INTERFACE down"
ifdown $OMR_TRACKER_INTERFACE
sleep 5
_log "Set $OMR_TRACKER_INTERFACE up"
ifup $OMR_TRACKER_INTERFACE
sleep 30
elif [ -n "$OMR_TRACKER_INTERFACE" ] && [ -n "$OMR_TRACKER_DEVICE" ] && [ "$(uci -q get network.$OMR_TRACKER_INTERFACE.proto)" = "modemmanager" ] && [ "$interface_up" = "false" ] && [ "$interface_available" = "false" ] && [ "$interface_pending" = "false" ] && [ "$interface_autostart" = "true" ]; then
modemfind="0"
for modem in $(timeout 3 mmcli -L | awk -F/ '{ print $6}' | awk '{print $1}'); do
modeminfo="$(timeout 2 mmcli -m $modem -K)"
@ -1067,6 +1068,7 @@ if [ -n "$OMR_TRACKER_INTERFACE" ] && [ -n "$OMR_TRACKER_DEVICE" ]; then
if [ -z "$metric" ] || ([ -n "$OMR_TRACKER_DEVICE_IP" ] && [ -z "$(ip route show table $metric | grep $OMR_TRACKER_DEVICE)" ]) || ([ -n "$OMR_TRACKER_DEVICE_IP6" ] && [ -z "$(ip -6 route show table 6${metric} | grep $OMR_TRACKER_DEVICE)" ]); then
_log "Routes not correctly set for $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE table $metric) with IPs $OMR_TRACKER_DEVICE_IP $OMR_TRACKER_DEVICE_IP6"
/etc/init.d/mptcp reload "$OMR_TRACKER_DEVICE"
/etc/init.d/omr-tracker restart
fi
fi

View file

@ -38,10 +38,10 @@ if [ -f /etc/init.d/unbound ] && [ "$(uci -q get unbound.@unbound[0].enabled)" =
_log "Can't find unbound, restart it..."
/etc/init.d/unbound restart 2>&1 >/dev/null
sleep 5
# elif [ "$(uci -q get openmptcprouter.settings.external_check)" != "0" ] && [ "$(uci -q get unbound.ub_main.listen_port)" = "5353" ] && [ -n "$(dig +timeout=4 +tries=1 openmptcprouter.com -p 5353 | grep 'ANSWER: 0')" ]; then
# _log "Can't resolve via unbound, restart it..."
# /etc/init.d/unbound restart 2>&1 >/dev/null
# sleep 5
elif [ "$(uci -q get openmptcprouter.settings.external_check)" != "0" ] && [ "$(uci -q get unbound.ub_main.listen_port)" = "5353" ] && [ -n "$(dig +timeout=4 +tries=1 openmptcprouter.com -p 5353 | grep 'ANSWER: 0')" ]; then
_log "Can't resolve via unbound, restart it..."
/etc/init.d/unbound restart 2>&1 >/dev/null
sleep 5
fi
fi

View file

@ -1,5 +1,6 @@
#!/bin/sh
[ ! -e /etc/init.d/omr-bypass ] && exit 0
bypassipvs4s=$(ipset -o save list omr_dst_bypass_srv_vpn1_4 2>/dev/null)
[ -z "$bypassipvs4s" ] && {
ipv4set=$(nft -j list set inet fw4 "omr_dst_bypass_srv_vpn1_4" 2>/dev/null)

View file

@ -560,6 +560,8 @@ while true; do
[ -z "$OMR_TRACKER_DEVICE_GATEWAY" ] && OMR_TRACKER_STATUS_MSG="$OMR_TRACKER_STATUS_MSG, interface have no IPv4 gateway"
[ "$OMR_TRACKER_IPV6" != "0" ] && [ -z "$OMR_TRACKER_DEVICE_IP6" ] && OMR_TRACKER_STATUS_MSG="$OMR_TRACKER_STATUS_MSG, interface have no IPv6"
[ "$OMR_TRACKER_IPV6" != "0" ] && [ -z "$OMR_TRACKER_DEVICE_GATEWAY6" ] && OMR_TRACKER_STATUS_MSG="$OMR_TRACKER_STATUS_MSG, interface have no IPv6 gateway"
elif [ "$OMR_TRACKER_STATUS" = "ERROR" ] && [ -z "$OMR_TRACKER_STATUS_MSG" ]; then
OMR_TRACKER_STATUS_MSG="No IP & Gateway detected for $OMR_TRACKER_INTERFACE"
fi
else
OMR_TRACKER_STATUS_MSG="link down"

View file

@ -11,12 +11,16 @@ config defaults 'defaults'
list hosts '80.67.169.40'
list hosts '114.114.114.114'
list hosts '1.1.1.1'
list hosts '208.67.222.222'
list hosts '208.67.222.220'
list hosts6 '2606:4700:4700::1111'
list hosts6 '2606:4700:4700::1001'
list hosts6 '2620:fe::fe'
list hosts6 '2620:fe::9'
list hosts6 '2001:4860:4860::8888'
list hosts6 '2001:4860:4860::8844'
list hosts6 '2620:119:35::35'
list hosts6 '2620:119:53::53'
option timeout '2'
option count '2'
option tries '3'
@ -43,6 +47,10 @@ config proxy 'proxy'
list hosts '1.1.1.1'
list hosts '74.82.42.42'
list hosts '176.103.130.130'
list hosts6 '2606:4700:4700::1111'
list hosts6 '2606:4700:4700::1001'
list hosts6 '2620:119:35::35'
list hosts6 '2620:119:53::53'
option timeout '10'
option tries '3'
option wait_test '0'

View file

@ -89,6 +89,15 @@ if [ -z "$(uci -q get omr-tracker.defaults.hosts6)" ]; then
commit omr-tracker
EOF
fi
if [ -z "$(uci -q get omr-tracker.proxy.hosts6)" ]; then
uci -q batch <<-EOF >/dev/null
add_list omr-tracker.proxy.hosts6='2606:4700:4700::1111'
add_list omr-tracker.proxy.hosts6='2606:4700:4700::1001'
add_list omr-tracker.proxy.hosts6='2620:119:35::35'
add_list omr-tracker.proxy.hosts6='2620:119:53::53'
commit omr-tracker
EOF
fi
if [ "$(uci -q get omr-tracker.defaults.wait_test)" = "" ]; then
uci -q batch <<-EOF >/dev/null

View file

@ -1501,6 +1501,9 @@ function interfaces_status()
elseif gateway6 ~= "" then
serverip = sys.exec('resolveip -6 ' .. value .. ' | head -n 1')
end
if serverip == "" then
serverip = value
end
if serverip ~= "" then
local server_ping_test = sys.exec("ping -B -w 1 -c 1 -I " .. ifname .. " " .. serverip)
local server_ping_result = ut.trim(sys.exec("echo '" .. server_ping_test .. "' | grep '100% packet loss'"))