From 5dc7ac2a3815775d2acb64b9faaa673e9350ca16 Mon Sep 17 00:00:00 2001 From: Orazio Date: Sat, 23 May 2020 15:26:03 +0200 Subject: [PATCH] Fix issue #1047 --- auto_install/install.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index a943bdc..7d58cfa 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -1552,13 +1552,8 @@ askClientDNS(){ #Call this function to use a regex to check user input for a valid custom domain validDomain(){ - local domain=$1 - local stat=1 - - if [[ $domain =~ ^(([a-zA-Z0-9]{1,63}|([a-zA-Z0-9]{1,60}[-a-zA-Z0-9()]{0,2}[a-zA-Z0-9]{1,60}))\.){1,6}([a-zA-Z]{2,})$ ]]; then - stat=$? - fi - return $stat + local domain="$1" + grep -qP '(?=^.{4,253}$)(^(?:[a-zA-Z0-9](?:(?:[a-zA-Z0-9\-]){0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$)' <<< "$domain" } #This procedure allows a user to specify a custom search domain if they have one.