mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-18 10:50:16 +00:00
Regex specifies : must start with alphanumeric, may have no more
than two consecutive hyphens, must not end or start with hyphen, final must be at least two apha characters. Signed-off-by: Rob Gill <rrobgill@protonmail.com>
This commit is contained in:
parent
9f20f50e61
commit
da4cc1ced5
1 changed files with 1 additions and 2 deletions
|
@ -389,8 +389,7 @@ function valid_domain()
|
|||
local domain=$1
|
||||
local stat=1
|
||||
|
||||
|
||||
if [[ $domain =~ ^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}\.[a-zA-Z]{2,}$ ]]; then
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue