Allow multiple hyphens in domain names

This commit is contained in:
Mirko Geissler committed 2016-08-11 13:08:20 +02:00
1 parent 83a8cd2f53
commit 6f9662af50
1 file changed
+1 -1
+1 -1
View File
@@ -1065,7 +1065,7 @@ strip_inline_comments() {
is_valid_hostname() { is_valid_hostname() {
declare desc="return 0 if argument is a valid hostname; else return 1" declare desc="return 0 if argument is a valid hostname; else return 1"
local hostname_string="${1,,}"; local hostname_regex='^(([a-z0-9\*](-?[a-z0-9])*)\.)+([a-z0-9\*](-?[a-z0-9])*)$' local hostname_string="${1,,}"; local hostname_regex='^([a-z0-9\-\*]+\.)*[a-z0-9\-\*]+$'
if [[ $hostname_string =~ $hostname_regex ]]; then if [[ $hostname_string =~ $hostname_regex ]]; then
return 0 return 0
else else