Only check existing certs when necessary

This commit is contained in:
Stefaan Ghysels
2019-08-26 10:28:01 +02:00
committed by Lukas Schauer
parent 199cd59774
commit 095165ee96

View File

@@ -1662,7 +1662,7 @@ command_sign_domains() {
fi
# Check domain names of existing certificate
if [[ -e "${cert}" ]]; then
if [[ -e "${cert}" && "${force_renew}" = "no" ]]; then
printf " + Checking domain name(s) of existing cert..."
certnames="$("${OPENSSL}" x509 -in "${cert}" -text -noout | grep DNS: | _sed 's/DNS://g' | tr -d ' ' | tr ',' '\n' | sort -u | tr '\n' ' ' | _sed 's/ $//')"