mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Set MTU only if not already set
This commit is contained in:
parent
77b071dd02
commit
70edb5abaa
1 changed files with 15 additions and 8 deletions
|
@ -224,23 +224,30 @@ fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Save wan settings for status page
|
# Save wan settings for status page
|
||||||
if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.omr_lc)" = "" ] || [ $(($(date +"%s") - $(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.omr_lc))) -gt 3600 ]; then
|
if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc)" = "" ] || [ $(($(date +"%s") - $(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc))) -gt 3600 ]; then
|
||||||
local ipaddr="$(omr-ip-intf $OMR_TRACKER_DEVICE)"
|
local ipaddr="$(omr-ip-intf $OMR_TRACKER_DEVICE)"
|
||||||
[ -n "$ipaddr" ] && {
|
[ -n "$ipaddr" ] && {
|
||||||
local asn="$(wget -4 -qO- -T 5 http://api.iptoasn.com/v1/as/ip/$ipaddr | jsonfilter -e '@.as_description')"
|
local asn="$(wget -4 -qO- -T 5 http://api.iptoasn.com/v1/as/ip/$ipaddr | jsonfilter -e '@.as_description')"
|
||||||
local serverip=$(uci -q get shadowsocks-libev.sss0.server)
|
local serverip=$(uci -q get shadowsocks-libev.sss0.server)
|
||||||
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mptcp_status="$(omr-tracebox-mptcp $serverip $OMR_TRACKER_DEVICE)"
|
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mptcp_status="$(omr-tracebox-mptcp $serverip $OMR_TRACKER_DEVICE)"
|
||||||
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.publicip="$ipaddr"
|
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.publicip="$ipaddr"
|
||||||
|
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.latency="$OMR_TRACKER_LATENCY"
|
||||||
[ -n "$asn" ] && {
|
[ -n "$asn" ] && {
|
||||||
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.asn="$asn"
|
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.asn="$asn"
|
||||||
}
|
}
|
||||||
local mtu=$(omr-mtu $OMR_TRACKER_DEVICE_IP $serverip)
|
if [ "$(uci -q get network.$OMR_TRACKER_INTERFACE.mtu)" = "" ]; then
|
||||||
[ -n "$mtu" ] && {
|
local mtu=$(omr-mtu $OMR_TRACKER_DEVICE_IP $serverip)
|
||||||
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mtu=$mtu
|
[ -n "$mtu" ] && {
|
||||||
ip link set dev $OMR_TRACKER_DEVICE mtu $mtu > /dev/null 2>&1
|
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mtu=$mtu
|
||||||
}
|
ip link set dev $OMR_TRACKER_DEVICE mtu $mtu > /dev/null 2>&1
|
||||||
[ -n "$mtu" ] && [ -n "$asn" ] && {
|
}
|
||||||
|
[ -n "$mtu" ] && [ -n "$asn" ] && {
|
||||||
|
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.lc=$(date +"%s")
|
||||||
|
}
|
||||||
|
elif [ -n "$asn" ]; then
|
||||||
|
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mtu=$(uci -q get network.$OMR_TRACKER_INTERFACE.mtu)
|
||||||
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.lc=$(date +"%s")
|
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.lc=$(date +"%s")
|
||||||
}
|
fi
|
||||||
|
uci -q commit openmptcprouter
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue