refresh certs only when letsencrypt is on

This commit is contained in:
rootzoll 2020-07-18 14:28:14 +02:00
parent e6bfe0f1ac
commit 0d075aaefb

View File

@ -105,11 +105,6 @@ function acme_install() {
function refresh_certs_with_nginx() {
if [ ! -d "${ACME_CERT_HOME}" ]; then
echo "# no cert directory to link: ${ACME_CERT_HOME}"
return
fi
# FIRST: SET ALL TO DEFAULT SELF SIGNED
echo "# default IP certs"
@ -126,6 +121,16 @@ function refresh_certs_with_nginx() {
# SECOND: SET LETSENCRPYT CERTS FOR SUBSCRIPTIONS
if [ "${letsencrypt}" != "on" ]; then
echo "# lets encrypt is off - so no certs replacements"
return
fi
if [ ! -d "${ACME_CERT_HOME}" ]; then
echo "# no cert directory to link: ${ACME_CERT_HOME}"
return
fi
certsDirectories=$(sudo ls ${ACME_CERT_HOME})
directoryArray=(`echo "${certsDirectories}" | tr ' ' ' '`)
for i in "${directoryArray[@]}"; do