diff --git a/bin/vhost-destroy.sh b/bin/vhost-destroy.sh index da0f07b..6f97663 100755 --- a/bin/vhost-destroy.sh +++ b/bin/vhost-destroy.sh @@ -44,14 +44,13 @@ fi # get & set username for this virtualhost username=$(stat -c '%U' /srv/www/$domain) -# check for a delete varnish config - # del virtualhost files & configs /usr/local/bin/vhost-del.sh -d $domain # check for any remaining virtualhosts before deleting user # same check is done in vhost-user-del.sh # but doing this here avoids generating any errors +existingvirtualhosts=false vhost::set-virtualhostArray for v in "${virtualhostArray[@]}" do @@ -60,6 +59,6 @@ do fi done -if [[ -n "$existingvirtualhosts" ]]; then +if [[ $existingvirtualhosts == "false" ]]; then /usr/local/bin/vhost-user-del.sh -u $username fi