mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-15 03:51:51 +00:00
Fix latency report on OMR-Tracker when not binding to an interface
This commit is contained in:
parent
245d1b43c4
commit
e02a8d8bd2
1 changed files with 9 additions and 4 deletions
|
@ -160,13 +160,18 @@ _ping() {
|
||||||
-t "$OMR_TRACKER_MAX_TTL" \
|
-t "$OMR_TRACKER_MAX_TTL" \
|
||||||
-Q 184 \
|
-Q 184 \
|
||||||
"${host}" 2>&1
|
"${host}" 2>&1
|
||||||
) && echo "$ret" | grep -sq " 0% packet loss" && {
|
)
|
||||||
|
if [ -n "$loss" ] && [ "$loss" != "100" ]; then
|
||||||
if [ "$localip" = "yes" ]; then
|
if [ "$localip" = "yes" ]; then
|
||||||
OMR_TRACKER_LATENCY=$(echo "$ret" | cut -d "/" -s -f5 | cut -d "." -f1 | tr -d '\n')
|
latency=$(echo "$ret" | grep rtt | cut -d "/" -s -f5 | cut -d "." -f1 | tr -d '\n')
|
||||||
#_update_rto "$OMR_TRACKER_LATENCY"
|
[ -n "$latency" ] && {
|
||||||
|
OMR_TRACKER_LATENCY="$latency"
|
||||||
|
#_update_rto "$OMR_TRACKER_LATENCY"
|
||||||
|
}
|
||||||
|
OMR_TRACKER_LOSS="$loss"
|
||||||
fi
|
fi
|
||||||
return
|
return
|
||||||
}
|
fi
|
||||||
else
|
else
|
||||||
ret=$(ping -B -I "${device}" \
|
ret=$(ping -B -I "${device}" \
|
||||||
-w "$OMR_TRACKER_TIMEOUT" \
|
-w "$OMR_TRACKER_TIMEOUT" \
|
||||||
|
|
Loading…
Reference in a new issue