mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Not possible to bind with 3g
This commit is contained in:
parent
a19dac4ee7
commit
e99391f888
1 changed files with 27 additions and 12 deletions
|
@ -93,18 +93,33 @@ _ping() {
|
||||||
local host=$1
|
local host=$1
|
||||||
local device=$2
|
local device=$2
|
||||||
local localip=$3
|
local localip=$3
|
||||||
ret=$(ping -B -I "${device}" \
|
if [ "$(uci -q get network.$OMR_TRACKER_INTERFACE.proto)" = "3g" ]; then
|
||||||
-w "$OMR_TRACKER_TIMEOUT" \
|
ret=$(ping -I "${device}" \
|
||||||
-c 1 \
|
-w "$OMR_TRACKER_TIMEOUT" \
|
||||||
-q \
|
-c 1 \
|
||||||
"${host}"
|
-q \
|
||||||
) && echo "$ret" | grep -sq " 0% packet loss" && {
|
"${host}"
|
||||||
if [ "$localip" = "yes" ]; then
|
) && echo "$ret" | grep -sq " 0% packet loss" && {
|
||||||
OMR_TRACKER_LATENCY=$(echo "$ret" | cut -d "/" -s -f5 | cut -d "." -f1)
|
if [ "$localip" = "yes" ]; then
|
||||||
_update_rto "$OMR_TRACKER_LATENCY"
|
OMR_TRACKER_LATENCY=$(echo "$ret" | cut -d "/" -s -f5 | cut -d "." -f1)
|
||||||
fi
|
_update_rto "$OMR_TRACKER_LATENCY"
|
||||||
return
|
fi
|
||||||
}
|
return
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ret=$(ping -B -I "${device}" \
|
||||||
|
-w "$OMR_TRACKER_TIMEOUT" \
|
||||||
|
-c 1 \
|
||||||
|
-q \
|
||||||
|
"${host}"
|
||||||
|
) && echo "$ret" | grep -sq " 0% packet loss" && {
|
||||||
|
if [ "$localip" = "yes" ]; then
|
||||||
|
OMR_TRACKER_LATENCY=$(echo "$ret" | cut -d "/" -s -f5 | cut -d "." -f1)
|
||||||
|
_update_rto "$OMR_TRACKER_LATENCY"
|
||||||
|
fi
|
||||||
|
return
|
||||||
|
}
|
||||||
|
fi
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue