Update comments

Fixed Latency result display

Signed-off-by: Teddysun <i@teddysun.com>
This commit is contained in:
Teddysun 2023-10-16 10:21:57 +09:00
parent 6d3418e094
commit 9bc6ce3b98
No known key found for this signature in database
GPG Key ID: 09BD4C080AD6C46D

View File

@ -62,7 +62,7 @@ speed_test() {
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
local dl_speed=$(awk '/Download/{print $3" "$4}' ./speedtest-cli/speedtest.log) local dl_speed=$(awk '/Download/{print $3" "$4}' ./speedtest-cli/speedtest.log)
local up_speed=$(awk '/Upload/{print $3" "$4}' ./speedtest-cli/speedtest.log) local up_speed=$(awk '/Upload/{print $3" "$4}' ./speedtest-cli/speedtest.log)
local latency=$(awk '/Latency/{print $2" "$3}' ./speedtest-cli/speedtest.log) local latency=$(awk '/Latency/{print $3" "$4}' ./speedtest-cli/speedtest.log)
if [[ -n "${dl_speed}" && -n "${up_speed}" && -n "${latency}" ]]; then if [[ -n "${dl_speed}" && -n "${up_speed}" && -n "${latency}" ]]; then
printf "\033[0;33m%-18s\033[0;32m%-18s\033[0;31m%-20s\033[0;36m%-12s\033[0m\n" " ${nodeName}" "${up_speed}" "${dl_speed}" "${latency}" printf "\033[0;33m%-18s\033[0;32m%-18s\033[0;31m%-20s\033[0;36m%-12s\033[0m\n" " ${nodeName}" "${up_speed}" "${dl_speed}" "${latency}"
fi fi