From dad3bf062f968ccba5edc7f9755e9d9a08773e3d Mon Sep 17 00:00:00 2001 From: Nils <32552517+byReqz@users.noreply.github.com> Date: Sat, 16 Jan 2021 02:06:27 +0000 Subject: [PATCH] improved ipv6 detection --- conn.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conn.sh b/conn.sh index 2ec655d..417996c 100644 --- a/conn.sh +++ b/conn.sh @@ -55,7 +55,8 @@ while [ ! -z "$1" ]; do fping -6 -c 4 -A $2 echo "------------------------------------------------" exit - elif [[ ! "$1" =~ [0-9]{1,3}(\.[0-9]{1,3}){3} ]];then + #this checks if the ip is (not) ipv4 and then checks if it includes a : + elif [[ ! "$1" =~ [0-9]{1,3}(\.[0-9]{1,3}){3} ]] && [[ "$1" =~ [:] ]];then echo "noticed IPv6 adress -> using -6" echo "checking connection status for $1" echo "-------------------Availability----------------------"