Commit 9f93ef5e authored by Markus Germeier's avatar Markus Germeier

change openssl to use enddate for expiry date check

parent 9c69b624
......@@ -221,8 +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
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.)"
valid=$(openssl x509 -enddate -noout -in "certs/${domain}/cert.pem" | cut -d= -f2- )
echo " ${valid} Skipping. (Valid longer than ${RENEW_DAYS} days.)"
continue
fi
echo " is within ${RENEW_DAYS} days. Renewing..."
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment