Commit a8ff7fa6 authored by Kubernetes's avatar Kubernetes

Fix issue #1

parent 252fa7ca
......@@ -61,7 +61,7 @@ __END_OF_USAGE__
# This function is used to perform tests with mtr
function test_mtr {
mtr -n -r -c 10 "${1}" > "${2}"
tail -n 1 "${1}" | awk --posix '/^[[:space:]]*[[:digit:]]+\.[[:space:]]+[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}[[:space:]]+[[:digit:]]+\.[[:digit:]]+%[[:space:]]+[[:digit:]]+[[:space:]]+[[:digit:]]+\.[[:digit:]]+[[:space:]]+[[:digit:]]+\.[[:digit:]]+[[:space:]]+[[:digit:]]+\.[[:digit:]]+[[:space:]]+[[:digit:]]+\.[[:digit:]]+[[:space:]]+[[:digit:]]+\.[[:digit:]]+[[:space:]]*$/ { percent = $3 + 0; if (percent > 0) { print percent } else { print "OK" } }'
tail -n 1 "${2}" | awk --posix '/^[[:space:]]*[[:digit:]]+\.[[:space:]]+[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}[[:space:]]+[[:digit:]]+\.[[:digit:]]+%[[:space:]]+[[:digit:]]+[[:space:]]+[[:digit:]]+\.[[:digit:]]+[[:space:]]+[[:digit:]]+\.[[:digit:]]+[[:space:]]+[[:digit:]]+\.[[:digit:]]+[[:space:]]+[[:digit:]]+\.[[:digit:]]+[[:space:]]+[[:digit:]]+\.[[:digit:]]+[[:space:]]*$/ { percent = $3 + 0; if (percent > 0) { print percent } else { print "OK" } }'
}
# This function is used to perform tests with traceroute and ping
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment