Skip to content

Commit

Permalink
update inc/nginx_addvhost.inc move existing vhost domain check higher…
Browse files Browse the repository at this point in the history
… up in 123.09beta01

move the existing vhost domain site check higher up in the routine for centmin.sh menu option 2 so that folks don't accidentally re-run centmin.sh menu option 2 for an existing domain setup on the server
  • Loading branch information
centminmod committed Oct 23, 2016
1 parent 1b2fdf3 commit 3882bf0
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion inc/nginx_addvhost.inc
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,18 @@ info_notice

read -ep "Enter vhost domain name to add (without www. prefix): " vhostname

if [ -d "/home/nginx/domains/$vhostname" ]; then
echo ""
cecho "-------------------------------------------------------------" $boldyellow
cecho "vhost for $vhostname already exists" $boldwhite
cecho "/home/nginx/domains/$vhostname already exists" $boldwhite
cecho "if you need to delete the domain read the guide at: " $boldwhite
cecho "centminmod.com/nginx_domain_dns_setup.html#deletevhost" $boldwhite
cecho "-------------------------------------------------------------" $boldyellow
echo ""
exit 1
fi

# check to make sure you don't add a domain name vhost that matches
# your server main hostname setup in server_name within main hostname
# nginx vhost at /usr/local/nginx/conf/conf.d/virtual.conf
Expand Down Expand Up @@ -353,7 +365,7 @@ fi

echo ""

if [ ! -d /home/nginx/domains/$vhostname ]; then
if [ ! -d "/home/nginx/domains/$vhostname" ]; then

# Checking Permissions, making directories, example index.html
umask 027
Expand Down

0 comments on commit 3882bf0

Please sign in to comment.