This commit is contained in:
Orazio 2020-05-23 15:26:03 +02:00
parent 3ec566c762
commit 5dc7ac2a38

View file

@ -1552,13 +1552,8 @@ askClientDNS(){
#Call this function to use a regex to check user input for a valid custom domain #Call this function to use a regex to check user input for a valid custom domain
validDomain(){ validDomain(){
local domain=$1 local domain="$1"
local stat=1 grep -qP '(?=^.{4,253}$)(^(?:[a-zA-Z0-9](?:(?:[a-zA-Z0-9\-]){0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$)' <<< "$domain"
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
} }
#This procedure allows a user to specify a custom search domain if they have one. #This procedure allows a user to specify a custom search domain if they have one.