From 28c76916b5538ea07975bd5a1f01e67d7edb9b06 Mon Sep 17 00:00:00 2001
From: pierreozoux <pierre@ozoux.net>
Date: Sun, 17 Apr 2016 10:46:44 +0200
Subject: [PATCH] If install is not needed, no mail needed neither

---
 utils/provision.sh | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/utils/provision.sh b/utils/provision.sh
index f69da18..2eaf32b 100755
--- a/utils/provision.sh
+++ b/utils/provision.sh
@@ -105,14 +105,13 @@ function buy_domain_name () {
 }
 
 function application () {
-  export MAIL_PASS=`tr -dc A-Za-z0-9_ < /dev/urandom | head -c 20 | xargs`
-  export MAIL_USER="noreply.${arg_u}@${MAIL_DOMAIN}"
-  export URL=${arg_u}
-  /data/indiehosters/utils/add_mailbox.sh ${MAIL_USER} ${MAIL_PASS}
-
   git clone https://${arg_a}.git /data/domains/${arg_u}
   cd /data/domains/${arg_u}
   if [ -f ./scripts/install ]; then
+    export MAIL_PASS=`tr -dc A-Za-z0-9_ < /dev/urandom | head -c 20 | xargs`
+    export MAIL_USER="noreply.${arg_u}@${MAIL_DOMAIN}"
+    export URL=${arg_u}
+    /data/indiehosters/utils/add_mailbox.sh ${MAIL_USER} ${MAIL_PASS}
     ./scripts/install
   fi
 }
-- 
GitLab