Browse Source

reset vars in vhost

bach 2 years ago
parent
commit
443fb016bd
1 changed files with 6 additions and 2 deletions
  1. 6 2
      bin/vhost.sh

+ 6 - 2
bin/vhost.sh

@@ -27,6 +27,7 @@ if [ "$vh" = "y" ]; then
     fi
   fi
 
+  _domain=""
   while [ "$_domain" = "" ]
   do
   read -p "enter a domain name ? " _domain
@@ -41,6 +42,7 @@ if [ "$vh" = "y" ]; then
   done
 
   # ask for simple php conf or drupal conf
+  _drupal=""
   while [ "$_drupal" != "yes" ] && [ "$_drupal" != "no" ]
   do
     echo -n "Is your site is a drupal one? [yes|no] "
@@ -48,6 +50,7 @@ if [ "$vh" = "y" ]; then
   done
 
   # ask for let's encrypt
+  _letsencrypt=""
   while [ "$_letsencrypt" != "yes" ] && [ "$_letsencrypt" != "no" ]
   do
     echo -e "\033[35;1mLet's encrypt \033[0m"
@@ -111,7 +114,8 @@ if [ "$vh" = "y" ]; then
   yn=${yn:-y}
   if [ "$yn" = "Y" ] || [ "$yn" = "y" ]; then
     # if $user var does not exists (vhost.sh ran directly) ask for it
-    if [ -z ${user+x} ]; then
+    user=""
+    # if [ -z ${user+x} ]; then
       while [ "$user" = "" ]
       do
         read -p "enter an existing user name ? " user
@@ -130,7 +134,7 @@ if [ "$vh" = "y" ]; then
           fi
         fi
       done
-    fi
+    # fi
 
     echo "shortcut will be installed for '$user'";
     sleep 3