1
0
mirror of https://github.com/byReqz/conn.git synced 2024-11-01 01:03:14 +00:00

improved ipv6 detection

This commit is contained in:
Nils 2021-01-16 02:06:27 +00:00 committed by GitHub
parent 514450d3af
commit dad3bf062f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,7 +55,8 @@ while [ ! -z "$1" ]; do
fping -6 -c 4 -A $2 fping -6 -c 4 -A $2
echo "------------------------------------------------" echo "------------------------------------------------"
exit 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 "noticed IPv6 adress -> using -6"
echo "checking connection status for $1" echo "checking connection status for $1"
echo "-------------------Availability----------------------" echo "-------------------Availability----------------------"