From f6aa7b80b041d6b8f957a46bd272276291a19f16 Mon Sep 17 00:00:00 2001
From: pierreozoux <pierre@ozoux.net>
Date: Mon, 21 Sep 2015 18:18:43 +0100
Subject: [PATCH] DRY!

---
 utils/provision.sh | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/utils/provision.sh b/utils/provision.sh
index 02350bd..8be0e8e 100755
--- a/utils/provision.sh
+++ b/utils/provision.sh
@@ -143,16 +143,7 @@ function generate_certificate () {
   echo ""
   cat ${TLS_FOLDER}/CSR/${arg_u}.csr
 
-  echo ""
-  info "You should have received a certificate."
-  info "Please paste your certificate now: (finish with ctrl-d)"
-
-  cat > ${TLS_FOLDER}/CSR/${arg_u}.crt
-
-  info "Concat certificate, CA and key into pem file."
-  cat ${TLS_FOLDER}/CSR/${arg_u}.crt /data/indiehosters/certs/sub.class2.server.sha2.ca.pem /data/indiehosters/certs/ca-sha2.pem ${TLS_FOLDER}/CSR/${arg_u}.key > ${TLS_FOLDER}/${arg_u}.pem
-
-  /data/indiehosters/utils/append_crt_list.sh ${arg_u}
+  paste_certificate
 }
 
 function paste_certificate () {
@@ -164,6 +155,8 @@ function paste_certificate () {
 
   info "Concat certificate, CA and key into pem file."
   cat ${TLS_FOLDER}/CSR/${arg_u}.crt /data/indiehosters/certs/sub.class2.server.sha2.ca.pem /data/indiehosters/certs/ca-sha2.pem ${TLS_FOLDER}/CSR/${arg_u}.key > ${TLS_FOLDER}/${arg_u}.pem
+  
+  /data/indiehosters/utils/append_crt_list.sh ${arg_u}
 }
 
 ### Parse commandline options
-- 
GitLab