mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-14 11:31:51 +00:00
Fix ping error in OMR-Tracker-server
This commit is contained in:
parent
aa566bf3a6
commit
c10983f2de
1 changed files with 7 additions and 4 deletions
|
@ -32,9 +32,11 @@ _ping_server() {
|
|||
-c 1 \
|
||||
-q \
|
||||
"${host}" 2>&1
|
||||
) && echo "$ret" | grep -sq " 0% packet loss" && {
|
||||
)
|
||||
loss=$(echo "$ret" | awk '/packet loss/ {gsub("%","");print $6}' | tr -d '\n')
|
||||
if [ -n "$loss" ] && [ "$loss" != "100" ]; then
|
||||
server_ping=true
|
||||
}
|
||||
fi
|
||||
}
|
||||
|
||||
_ping_server_intf() {
|
||||
|
@ -49,9 +51,10 @@ _ping_server_intf() {
|
|||
-I "$intf" \
|
||||
"${host}" 2>&1
|
||||
)
|
||||
[ -n "$ret" ] && echo "$ret" | grep -sq " 0% packet loss" && {
|
||||
loss=$(echo "$ret" | awk '/packet loss/ {gsub("%","");print $6}' | tr -d '\n')
|
||||
if [ -n "$loss" ] && [ "$loss" != "100" ]; then
|
||||
server_ping=true
|
||||
}
|
||||
fi
|
||||
k=$((k+1))
|
||||
sleep "${intervaltries}"
|
||||
done
|
||||
|
|
Loading…
Reference in a new issue