diff --git a/bin/vhost-enable.sh b/bin/vhost-enable.sh index 65e7887..8c85513 100755 --- a/bin/vhost-enable.sh +++ b/bin/vhost-enable.sh @@ -90,12 +90,17 @@ fi # set username for all VHost macros if [[ "$macro" == *"VHost"* ]]; then # check for vhost dir - if [[ -d "/srv/www/$domain" ]]; then + if [[ "$macro" == *"Alias"* ]]; then + vhost=$option + else + vhost=$domain + fo + if [[ -d "/srv/www/$vhost" ]]; then # get and set $username - username=$(stat -c '%U' /srv/www/$domain) + username=$(stat -c '%U' /srv/www/$vhost) macro_vhost_line="$macro_vhost_line $username" else - echo "VirtualHost dir for $domain does not exist." + echo "VirtualHost dir for $vhost does not exist." exit 1 fi # check for and set Subdomain