Merge pull request #2258 from dokku/2257_mh-domains-regex

support domains that start with digits per RFC1123
This commit is contained in:
Jose Diaz-Gonzalez
2016-06-20 22:47:12 -04:00
committed by GitHub
2 changed files with 6 additions and 2 deletions

View File

@@ -1057,7 +1057,7 @@ strip_inline_comments() {
is_valid_hostname() {
declare desc="return 0 if argument is a valid hostname; else return 1"
local hostname_string="$1"; local hostname_regex='^(([a-zA-Z\*](-?[a-zA-Z0-9])*)\.)*[a-zA-Z\*](-?[a-zA-Z0-9])+\.[a-zA-Z]{2,}$'
local hostname_string="$1"; local hostname_regex='^(([a-zA-Z0-9\*](-?[a-zA-Z0-9])*)\.)*[a-zA-Z\*](-?[a-zA-Z0-9])+\.[a-zA-Z]{2,}$'
if [[ $hostname_string =~ $hostname_regex ]]; then
return 0
else