fix existing vhost check

This commit is contained in:
Matthew Saunders Brown 2022-09-13 12:59:36 -07:00
parent 5adac1b4b3
commit 2529f4a30f

View File

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