diff --git a/helpers/funcs b/helpers/funcs index 80f45f2..57e87f5 100755 --- a/helpers/funcs +++ b/helpers/funcs @@ -784,12 +784,17 @@ logger(){ } test_ping(){ shift + local time + local res local ip="$1" local qport="$2" - local res - res=$(ping -c1 -4 -W0.5 $1 | grep time= | awk -F= '{print $4}') - [[ ! $? -eq 0 ]] && res="Timed out" - printf "%s" "$res" + res=$(a2s $ip $qport info) + if [[ -z $res ]]; then + time="Timed out" + else + time=$(<<< "$res" jq -r '.[].ping') + fi + printf "%s" "$time" } show_server_modlist(){ shift