1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Smaller timeout

This commit is contained in:
Ycarus (Yannick Chabanois) 2019-08-05 16:57:21 +02:00
parent 58b9d0c45e
commit 58d4668e4b
2 changed files with 6 additions and 6 deletions

View file

@ -1,7 +1,7 @@
#!/bin/sh
INTERFACE=$2
if [ -z "$INTERFACE" ]; then
tracebox -m 30 -l "pkt = ip{dst=to} / tcp{dst=65101} / MPCAPABLE / MSS / WSCALE if string.find(tostring(tracebox(pkt)),'-TCPOptionMPTCPCapable') then print 'MPTCP disabled' elseif string.find(tostring(tracebox(pkt)),'MPTCP') then print 'MPTCP enabled' end" $1
tracebox -m 20 -l "pkt = ip{dst=to} / tcp{dst=65101} / MPCAPABLE / MSS / WSCALE if string.find(tostring(tracebox(pkt)),'-TCPOptionMPTCPCapable') then print 'MPTCP disabled' elseif string.find(tostring(tracebox(pkt)),'MPTCP') then print 'MPTCP enabled' end" $1
else
tracebox -m 30 -l "pkt = ip{dst=to} / tcp{dst=65101} / MPCAPABLE / MSS / WSCALE if string.find(tostring(tracebox(pkt)),'-TCPOptionMPTCPCapable') then print 'MPTCP disabled' elseif string.find(tostring(tracebox(pkt)),'MPTCP') then print 'MPTCP enabled' end" -i $INTERFACE $1
tracebox -m 20 -l "pkt = ip{dst=to} / tcp{dst=65101} / MPCAPABLE / MSS / WSCALE if string.find(tostring(tracebox(pkt)),'-TCPOptionMPTCPCapable') then print 'MPTCP disabled' elseif string.find(tostring(tracebox(pkt)),'MPTCP') then print 'MPTCP enabled' end" -i $INTERFACE $1
fi

View file

@ -416,9 +416,9 @@ if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc)" = "" ] || [ $(($(
# Check if we can get a IPv6 address, if yes enable RA else disable
local check_ipv6_website="$(uci -q get openmptcprouter.settings.check_ipv6_website)"
[ -z "$check_ipv6_website" ] && check_ipv6_website="http://ipv6.openmptcprouter.com/"
local ip6addr="$(curl -s -6 -m 3 $check_ipv6_website)"
local ip6addr="$(curl -s -6 -m 2 $check_ipv6_website)"
[ -z "$ip6addr" ] && {
local ip6addr="$(curl -s -6 -m 3 http://ifconfig.co/)"
local ip6addr="$(curl -s -6 -m 2 http://ifconfig.co/)"
}
if [ "$(uci -q get openmptcprouter.settings.ipv6_disable)" = "0" ]; then
if [ -n "$ip6addr" ] && [ "$(uci -q get dhcp.lan.ra_default)" != 1 ]; then
@ -437,7 +437,7 @@ if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc)" = "" ] || [ $(($(
fi
fi
if [ "$(uci -q get openmptcprouter.settings.external_check)" != "0" ]; then
local asn="$(wget -4 -qO- -T 5 http://api.iptoasn.com/v1/as/ip/$ipaddr | jsonfilter -q -e '@.as_description')"
local asn="$(wget -4 -qO- -T 4 http://api.iptoasn.com/v1/as/ip/$ipaddr | jsonfilter -q -e '@.as_description')"
[ -z "$asn" ] && {
asn="$(whois $ipaddr 2>/dev/null | grep -m 1 -i 'netname' | awk '{print $2}')"
}
@ -446,7 +446,7 @@ if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc)" = "" ] || [ $(($(
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE=interface
}
if [ "$(uci -q get openmptcprouter.latest_versions.lc)" = "" ] || [ $(($(date +"%s") - $(uci -q get openmptcprouter.latest_versions.lc))) -gt 3600 ]; then
local latestversions="$(wget -4 -qO- -T 5 http://www.openmptcprouter.com/version/version.json)"
local latestversions="$(wget -4 -qO- -T 3 http://www.openmptcprouter.com/version/version.json)"
[ -n "$latestversions" ] && {
uci -q set openmptcprouter.latest_versions=latest_versions
uci -q set openmptcprouter.latest_versions.omr=$(echo $latestversions | jsonfilter -q -e '@.omr')