Don't validate regex domains

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
This commit is contained in:
Mcat12 2018-06-28 23:21:01 -04:00
parent cffb4de83b
commit 8435eeed4d
No known key found for this signature in database
GPG key ID: ABB8FC9789AF524D

View file

@ -66,10 +66,14 @@ HandleOther() {
# Convert to lowercase
domain="${1,,}"
# Check validity of domain
# Check validity of domain (don't check for regex entries)
if [[ "${#domain}" -le 253 ]]; then
validDomain=$(grep -P "^((-|_)*[a-z\d]((-|_)*[a-z\d])*(-|_)*)(\.(-|_)*([a-z\d]((-|_)*[a-z\d])*))*$" <<< "${domain}") # Valid chars check
validDomain=$(grep -P "^[^\.]{1,63}(\.[^\.]{1,63})*$" <<< "${validDomain}") # Length of each label
if [[ "${listMain}" == "${regexlist}" ]]; then
validDomain=""
else
validDomain=$(grep -P "^((-|_)*[a-z\d]((-|_)*[a-z\d])*(-|_)*)(\.(-|_)*([a-z\d]((-|_)*[a-z\d])*))*$" <<< "${domain}") # Valid chars check
validDomain=$(grep -P "^[^\.]{1,63}(\.[^\.]{1,63})*$" <<< "${validDomain}") # Length of each label
fi
fi
if [[ -n "${validDomain}" ]]; then