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

Return latencies without endline

This commit is contained in:
Ycarus (Yannick Chabanois) 2022-06-02 15:54:17 +02:00
parent 3836f9a225
commit c9ad59784e

View file

@ -153,7 +153,7 @@ _ping() {
"${host}" 2>&1
) && echo "$ret" | grep -sq "bytes from" && {
if [ "$localip" = "yes" ]; then
OMR_TRACKER_LATENCY=$(echo "$ret" | cut -d "/" -s -f5 | cut -d "." -f1)
OMR_TRACKER_LATENCY=$(echo "$ret" | cut -d "/" -s -f5 | cut -d "." -f1 | tr -d '\n')
_update_rto "$OMR_TRACKER_LATENCY"
fi
return
@ -166,7 +166,7 @@ _ping() {
"${host}" 2>&1
) && echo "$ret" | grep -sq "bytes from" && {
if [ "$localip" = "yes" ]; then
OMR_TRACKER_LATENCY=$(echo "$ret" | cut -d "/" -s -f5 | cut -d "." -f1)
OMR_TRACKER_LATENCY=$(echo "$ret" | cut -d "/" -s -f5 | cut -d "." -f1 | tr -d '\n')
_update_rto "$OMR_TRACKER_LATENCY"
fi
return