Fix is_global_vhost_enabled() for multiple vhosts
This commit is contained in:
1 parent
bdc3353a5c
commit
fc452e90d4
1 file changed
+7
-4
@@ -824,13 +824,16 @@ get_global_vhosts() {
|
|||||||
is_global_vhost_enabled() {
|
is_global_vhost_enabled() {
|
||||||
declare desc="returns true if we have a valid global vhost set; otherwise returns false"
|
declare desc="returns true if we have a valid global vhost set; otherwise returns false"
|
||||||
local GLOBAL_VHOSTS=$(get_global_vhosts)
|
local GLOBAL_VHOSTS=$(get_global_vhosts)
|
||||||
local GLOBAL_VHOSTS_ENABLED=true
|
local GLOBAL_VHOSTS_ENABLED=false
|
||||||
local RE_IPV4="$(get_ipv4_regex)"
|
local RE_IPV4="$(get_ipv4_regex)"
|
||||||
local RE_IPV6="$(get_ipv6_regex)"
|
local RE_IPV6="$(get_ipv6_regex)"
|
||||||
|
|
||||||
if [[ -z "$GLOBAL_VHOSTS" ]] || [[ "$GLOBAL_VHOSTS" =~ $RE_IPV4 ]] || [[ "$GLOBAL_VHOSTS" =~ $RE_IPV6 ]]; then
|
while read -r GLOBAL_VHOST; do
|
||||||
local GLOBAL_VHOSTS_ENABLED=false
|
if (is_valid_hostname "$GLOBAL_VHOST"); then
|
||||||
fi
|
local GLOBAL_VHOSTS_ENABLED=true
|
||||||
|
fi
|
||||||
|
done <<< "$GLOBAL_VHOSTS"
|
||||||
|
|
||||||
echo $GLOBAL_VHOSTS_ENABLED
|
echo $GLOBAL_VHOSTS_ENABLED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user