added error messages to letsencrypt on startup (#898)

This commit is contained in:
akmet 2018-03-15 08:01:44 +01:00 committed by Johan Smits
parent 570237232c
commit 68aaeba59f

View file

@ -790,6 +790,8 @@ function _setup_ssl() {
KEY="privkey"
elif [ -e "/etc/letsencrypt/live/$HOSTNAME/key.pem" ]; then
KEY="key"
else
notify 'err' "Cannot access '/etc/letsencrypt/live/"$HOSTNAME"/privkey.pem' nor 'key.pem'"
fi
if [ -n "$KEY" ]; then
notify 'inf' "Adding $HOSTNAME SSL certificate"
@ -803,7 +805,11 @@ function _setup_ssl() {
sed -i -e 's~ssl_key = </etc/dovecot/ssl/dovecot\.key~ssl_key = </etc/letsencrypt/live/'$HOSTNAME'/'"$KEY"'\.pem~g' /etc/dovecot/conf.d/10-ssl.conf
notify 'inf' "SSL configured with 'letsencrypt' certificates"
else
notify 'err' "Key filename not set!"
fi
else
notify 'err' "Cannot access '/etc/letsencrypt/live/"$HOSTNAME"/fullchain.pem'"
fi
;;
"custom" )