mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Fix and optimize OMR-Tracker
This commit is contained in:
parent
a36a5f7563
commit
f2546261fe
1 changed files with 6 additions and 3 deletions
|
@ -161,9 +161,10 @@ _ping() {
|
|||
-Q 184 \
|
||||
"${host}" 2>&1
|
||||
)
|
||||
loss=$(echo "$ret" | awk '/packet loss/ {gsub("%","");print $6}' | tr -d '\n')
|
||||
if [ -n "$loss" ] && [ "$loss" != "100" ]; then
|
||||
if [ "$localip" = "yes" ]; then
|
||||
latency=$(echo "$ret" | grep rtt | cut -d "/" -s -f5 | cut -d "." -f1 | tr -d '\n')
|
||||
latency=$(echo "$ret" | awk -F/ '/rtt/ {print int($5)}' | tr -d '\n')
|
||||
[ -n "$latency" ] && {
|
||||
OMR_TRACKER_LATENCY="$latency"
|
||||
#_update_rto "$OMR_TRACKER_LATENCY"
|
||||
|
@ -184,10 +185,12 @@ _ping() {
|
|||
bindcheck=$(echo "$ret" | grep "Address not available")
|
||||
[ -n "$bindcheck" ] && OMR_TRACKER_NO_BIND=1
|
||||
#loss=$(echo "$ret" | grep 'packet loss' | sed -ne 's/.*\([0-9]\+\)% packet loss.*/\1/p')
|
||||
loss=$(echo "$ret" | grep 'packet loss' | cut -d " " -f6 | sed 's/%//' | tr -d '\n')
|
||||
#loss=$(echo "$ret" | grep 'packet loss' | cut -d " " -f6 | sed 's/%//' | tr -d '\n')
|
||||
loss=$(echo "$ret" | awk '/packet loss/ {gsub("%","");print $6}' | tr -d '\n')
|
||||
if [ -n "$loss" ] && [ "$loss" != "100" ]; then
|
||||
if [ "$localip" = "yes" ]; then
|
||||
latency=$(echo "$ret" | grep rtt | 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')
|
||||
latency=$(echo "$ret" | awk -F/ '/rtt/ {print int($5)}' | tr -d '\n')
|
||||
[ -n "$latency" ] && {
|
||||
OMR_TRACKER_LATENCY="$latency"
|
||||
#_update_rto "$OMR_TRACKER_LATENCY"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue