Skip to content

Commit

Permalink
Fix OMR-Tracker when latency is empty?
Browse files Browse the repository at this point in the history
  • Loading branch information
Ysurac committed Jan 12, 2024
1 parent d9b345e commit 37498c1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions omr-tracker/files/bin/omr-tracker
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 37498c1

Please sign in to comment.