From bca57c483d71c29de45277704b5004577717508f Mon Sep 17 00:00:00 2001 From: angristan Date: Mon, 1 Oct 2018 21:00:26 +0200 Subject: [PATCH] Fix "ping6" and "ping -6" usage --- openvpn-install.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index f49a3d9..cf2d6e7 100644 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -211,7 +211,13 @@ function installQuestions () { echo "" echo "Checking for IPv6 connectivity..." echo "" - if ping -6 -c4 ipv6.google.com > /dev/null 2>&1; then + # "ping6" and "ping -6" availability varies depending on the distribution + if type ping6 > /dev/null 2>&1; then + PING6="ping6 -c3 ipv6.google.com > /dev/null 2>&1" + else + PING6="ping -6 -c3 ipv6.google.com > /dev/null 2>&1" + fi + if eval "$PING6"; then echo "Your host appears to have IPv6 connectivity." SUGGESTION="y" else