From eb0703500a0df6916a1b20264ea5fca4d1c528f4 Mon Sep 17 00:00:00 2001 From: Mason Rowe Date: Sun, 6 Oct 2019 22:39:53 -0400 Subject: [PATCH] ipv4/ipv6-compatibility (via ping) hotfix --- yabs.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yabs.sh b/yabs.sh index 5f08357..3e21244 100755 --- a/yabs.sh +++ b/yabs.sh @@ -161,9 +161,10 @@ function launch_iperf { done } -IPV4_CHECK=$(ping -c 1 -W 4 -4 google.com) +PING_FLAG=$(man ping | grep -- " -4") +[ -z "$PING_FLAG" ] && IPV4_CHECK=$(ping -c 1 -W 4 google.com) || IPV4_CHECK=$(ping -c 1 -W 4 -4 google.com) [[ "$IPV4_CHECK" == *"1 received"* ]] && IPV4_CHECK="True" || IPV4_CHECK="" -IPV6_CHECK=$(ping -c 1 -W 4 -6 ipv6.google.com) +[ -z "$PING_FLAG" ] && IPV6_CHECK=$(ping6 -c 1 -W 4 ipv6.google.com) || IPV6_CHECK=$(ping -c 1 -W 4 -6 ipv6.google.com) [[ "$IPV6_CHECK" == *"1 received"* ]] && IPV6_CHECK="True" || IPV6_CHECK="" IPERF_LOCS=( \