1
0
Fork 0
mirror of https://github.com/aclist/dztui.git synced 2024-12-29 13:52:03 +01:00

Add timeout message to table

This commit is contained in:
aclist 2022-01-11 18:48:48 +09:00 committed by GitHub
parent f4c10fbe4f
commit 0b74605b4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -57,6 +57,7 @@ check_ping(){
if [[ $ping -eq 1 ]]; then if [[ $ping -eq 1 ]]; then
ping_ip=$(echo -e "$i" | awk -F'\t' '{print $2}' | awk -F: '{print $1}') ping_ip=$(echo -e "$i" | awk -F'\t' '{print $2}' | awk -F: '{print $1}')
ms=$(ping -c 1 "$ping_ip" | awk -Ftime= '/time=/ {print $2}') ms=$(ping -c 1 "$ping_ip" | awk -Ftime= '/time=/ {print $2}')
[[ -z $ms ]] && ms="Timeout" || :
printf "%s\t%s\n" "$i" "$ms" printf "%s\t%s\n" "$i" "$ms"
else else
printf "%s\n" "$i" printf "%s\n" "$i"