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

Fix OMR-Tracker when latency is empty?

This commit is contained in:
Ycarus (Yannick Chabanois) 2024-01-12 20:17:08 +01:00
parent d9b345e746
commit 37498c1725

View file

@ -176,9 +176,12 @@ _ping() {
loss=$(echo "$ret" | grep 'packet loss' | sed -ne 's/.*\([0-9]\+\)% packet loss.*/\1/p')
if [ -n "$loss" ] && [ "$loss" -ne 100 ]; then
if [ "$localip" = "yes" ]; then
OMR_TRACKER_LATENCY=$(echo "$ret" | cut -d "/" -s -f5 | cut -d "." -f1 | tr -d '\n')
latency=$(echo "$ret" | 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"
_update_rto "$OMR_TRACKER_LATENCY"
fi
return
fi