From fc452e90d4a454759243365c311153c235e86bf4 Mon Sep 17 00:00:00 2001 From: Mirko Geissler Date: Thu, 30 Jun 2016 10:42:50 +0200 Subject: [PATCH] Fix is_global_vhost_enabled() for multiple vhosts --- plugins/common/functions | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/common/functions b/plugins/common/functions index d248ff155..d3355830c 100755 --- a/plugins/common/functions +++ b/plugins/common/functions @@ -824,13 +824,16 @@ get_global_vhosts() { is_global_vhost_enabled() { declare desc="returns true if we have a valid global vhost set; otherwise returns false" local GLOBAL_VHOSTS=$(get_global_vhosts) - local GLOBAL_VHOSTS_ENABLED=true + local GLOBAL_VHOSTS_ENABLED=false local RE_IPV4="$(get_ipv4_regex)" local RE_IPV6="$(get_ipv6_regex)" - if [[ -z "$GLOBAL_VHOSTS" ]] || [[ "$GLOBAL_VHOSTS" =~ $RE_IPV4 ]] || [[ "$GLOBAL_VHOSTS" =~ $RE_IPV6 ]]; then - local GLOBAL_VHOSTS_ENABLED=false - fi + while read -r GLOBAL_VHOST; do + if (is_valid_hostname "$GLOBAL_VHOST"); then + local GLOBAL_VHOSTS_ENABLED=true + fi + done <<< "$GLOBAL_VHOSTS" + echo $GLOBAL_VHOSTS_ENABLED }