Skip to content

Commit

Permalink
Fix ping error in OMR-Tracker-server
Browse files Browse the repository at this point in the history
  • Loading branch information
Ysurac committed Sep 2, 2024
1 parent aa566bf commit c10983f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions omr-tracker/files/bin/omr-tracker-server
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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
Expand Down

0 comments on commit c10983f

Please sign in to comment.