1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-13 02:51:50 +00:00

Fix latency report on OMR-Tracker when not binding to an interface

This commit is contained in:
Ycarus (Yannick Chabanois) 2024-07-16 09:10:53 +02:00
parent 245d1b43c4
commit e02a8d8bd2

View file

@ -160,13 +160,18 @@ _ping() {
-t "$OMR_TRACKER_MAX_TTL" \
-Q 184 \
"${host}" 2>&1
) && echo "$ret" | grep -sq " 0% packet loss" && {
)
if [ -n "$loss" ] && [ "$loss" != "100" ]; then
if [ "$localip" = "yes" ]; then
OMR_TRACKER_LATENCY=$(echo "$ret" | cut -d "/" -s -f5 | cut -d "." -f1 | tr -d '\n')
#_update_rto "$OMR_TRACKER_LATENCY"
latency=$(echo "$ret" | grep rtt | cut -d "/" -s -f5 | cut -d "." -f1 | tr -d '\n')
[ -n "$latency" ] && {
OMR_TRACKER_LATENCY="$latency"
#_update_rto "$OMR_TRACKER_LATENCY"
}
OMR_TRACKER_LOSS="$loss"
fi
return
}
fi
else
ret=$(ping -B -I "${device}" \
-w "$OMR_TRACKER_TIMEOUT" \