mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-18 19:00:15 +00:00
Fix issue #1047
This commit is contained in:
parent
3ec566c762
commit
5dc7ac2a38
1 changed files with 2 additions and 7 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue