From b5983a3fc1b2c6f3b02ada596d812ed3cd76384d Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 4 Aug 2020 22:11:32 +0200 Subject: [PATCH] Do not require first element to be a hex value at any costs. It may also be a : in the valid address ::1 Signed-off-by: DL6ER --- automated install/basic-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index c5e2c1ff..ac00bf2b 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1054,7 +1054,7 @@ valid_ip6() { # optional port number starting '#' with range of 1-65536 local portelem="(#([1-9]|[1-8][0-9]|9[0-9]|[1-8][0-9]{2}|9[0-8][0-9]|99[0-9]|[1-8][0-9]{3}|9[0-8][0-9]{2}|99[0-8][0-9]|999[0-9]|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-6]))?" # build a full regex string from the above parts - local regex="^(((${ipv6elem}))((:${ipv6elem}))*::((${ipv6elem}))*((:${ipv6elem}))*|((${ipv6elem}))((:${ipv6elem})){7})${v6cidr}${portelem}$" + local regex="^(((${ipv6elem}))*((:${ipv6elem}))*::((${ipv6elem}))*((:${ipv6elem}))*|((${ipv6elem}))((:${ipv6elem})){7})${v6cidr}${portelem}$" [[ ${ip} =~ ${regex} ]]