From 2529f4a30f5df59f98e233f8e739350468b522aa Mon Sep 17 00:00:00 2001 From: Matthew Saunders Brown Date: Tue, 13 Sep 2022 12:59:36 -0700 Subject: [PATCH] fix existing vhost check --- bin/vhost-destroy.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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