I am using below script to validate IPV6 address but this script also pass invalid IP such as empty string, name etc.
if [[ "$IPv6ADDR"=~"^:?([a-fA-F0-9]{1,4}(:|.)?){0,8}(:|::)?([a-fA-F0-9]{1,4}(:|.)?){0,8}$" ]]; then
echo "valid ipv6 addr"
break;
else
echo "Invalid IP Address"
break;
fi
Can someone identify what's wrong in the regex, Please?