From ec6c7d84c141e3e4a01feb57f2692cec2a5dba1a Mon Sep 17 00:00:00 2001 From: Joshua Tauberer Date: Sun, 22 Jun 2014 12:48:21 +0000 Subject: [PATCH] dont ask for a CSR country code on second runs because the CSR is already generated and any new country code won't be used anyway --- setup/start.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/setup/start.sh b/setup/start.sh index fd55dafd..f05ba81e 100755 --- a/setup/start.sh +++ b/setup/start.sh @@ -67,6 +67,15 @@ if [ -z "$PUBLIC_IPV6" ]; then read -e -i "$DEFAULT_PUBLIC_IPV6" -p "Public IPv6: " PUBLIC_IPV6 fi +# We need a country code to generate a certificate signing request. However +# if a CSR already exists then we won't be generating a new one and there's +# no reason to ask for the country code now. $STORAGE_ROOT has not yet been +# set so we'll check if $DEFAULT_STORAGE_ROOT and $DEFAULT_CSR_COUNTRY are +# set (the values from the current mailinabox.conf) and if the CSR exists +# in the expected location. +if [ ! -z "$DEFAULT_STORAGE_ROOT" ] && [ ! -z "$DEFAULT_CSR_COUNTRY" ] && [ -f $DEFAULT_STORAGE_ROOT/ssl/ssl_cert_sign_req.csr ]; then + CSR_COUNTRY=$DEFAULT_CSR_COUNTRY +fi if [ -z "$CSR_COUNTRY" ]; then echo echo "Enter the two-letter, uppercase country code for where you"