1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2024-11-22 02:17:26 +00:00

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

This commit is contained in:
Joshua Tauberer 2014-06-22 12:48:21 +00:00
parent 8076ce4ab9
commit ec6c7d84c1

View File

@ -67,6 +67,15 @@ if [ -z "$PUBLIC_IPV6" ]; then
read -e -i "$DEFAULT_PUBLIC_IPV6" -p "Public IPv6: " PUBLIC_IPV6 read -e -i "$DEFAULT_PUBLIC_IPV6" -p "Public IPv6: " PUBLIC_IPV6
fi 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 if [ -z "$CSR_COUNTRY" ]; then
echo echo
echo "Enter the two-letter, uppercase country code for where you" echo "Enter the two-letter, uppercase country code for where you"