Browse Source

stop nginx at the begin of vhost install

Bachir Soussi Chiadmi 6 years ago
parent
commit
29c8d50b53
1 changed files with 3 additions and 1 deletions
  1. 3 1
      bin/vhost.sh

+ 3 - 1
bin/vhost.sh

@@ -56,6 +56,8 @@ if [ "$vh" = "y" ]; then
     read _letsencrypt
   done
 
+  systemctl stop nginx
+
   # lets'encrypt
   # https://certbot.eff.org/lets-encrypt/debianstretch-nginx
   if [ "$_letsencrypt" = "yes" ]; then
@@ -138,7 +140,7 @@ if [ "$vh" = "y" ]; then
   ln -s /etc/nginx/sites-available/"$_domain".conf /etc/nginx/sites-enabled/"$_domain".conf
 
   # restart nginx
-  systemctl restart nginx
+  systemctl start nginx
   echo -e "\033[92;1mvhost $_domain configured \033[Om"
 else
   echo -e "Vhost installation aborted"