From f275b27f34927d556a61f246b821dbaf4a89dec7 Mon Sep 17 00:00:00 2001 From: Mason Rowe Date: Fri, 24 Mar 2023 23:10:14 -0400 Subject: [PATCH] fix ping permission error (#61) --- yabs.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yabs.sh b/yabs.sh index 09a678f..b5e8db7 100644 --- a/yabs.sh +++ b/yabs.sh @@ -730,7 +730,8 @@ function iperf_test { done # Run a latency test via ping -c1 command -> will return "xx.x ms" - [[ ! -z $LOCAL_PING ]] && LATENCY_RUN="$(ping -c1 $URL | grep -Po 'time=.*' | sed s/'time='//)" || LATENCY_RUN="--" + [[ ! -z $LOCAL_PING ]] && LATENCY_RUN="$(ping -c1 $URL 2>/dev/null | grep -Po 'time=.*' | sed s/'time='//)" + [[ -z $LATENCY_RUN ]] && LATENCY_RUN="--" # parse the resulting send and receive speed results IPERF_SENDRESULT="$(echo "${IPERF_RUN_SEND}" | grep SUM | grep receiver)"