From: Markus Germeier Date: Sun, 6 Dec 2015 16:03:59 +0000 (+0100) Subject: show expire date when we don't need to renew a certifcate X-Git-Tag: v0.1.0~198^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c69b624c2118ff3dca011296b3eb21bae491ef8;p=thirdparty%2Fdehydrated.git show expire date when we don't need to renew a certifcate --- diff --git a/letsencrypt.sh b/letsencrypt.sh index 2f6e0f2..0971032 100755 --- a/letsencrypt.sh +++ b/letsencrypt.sh @@ -221,7 +221,8 @@ fi echo -n "Found existing cert for ${domain}. Expire date ..." set +e; openssl x509 -checkend $((${RENEW_DAYS} * 86400)) -noout -in "certs/${domain}/cert.pem"; expiring=$?; set -e if [[ ${expiring} -eq 0 ]]; then - echo " is not within ${RENEW_DAYS} days. Skipping" + valid=$(openssl x509 -text -noout -in "certs/${domain}/cert.pem" | grep -i "not after" | cut -d: -f2- ) + echo "${valid} Skipping. (Valid longer than ${RENEW_DAYS} days.)" continue fi echo " is within ${RENEW_DAYS} days. Renewing..."