1
0
Fork 0
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:
Ycarus (Yannick Chabanois) 2019-11-19 18:37:04 +01:00
parent a19dac4ee7
commit e99391f888

View file

@ -93,6 +93,20 @@ _ping() {
local host=$1
local device=$2
local localip=$3
if [ "$(uci -q get network.$OMR_TRACKER_INTERFACE.proto)" = "3g" ]; then
ret=$(ping -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
}
else
ret=$(ping -B -I "${device}" \
-w "$OMR_TRACKER_TIMEOUT" \
-c 1 \
@ -105,6 +119,7 @@ _ping() {
fi
return
}
fi
false
}