From: Simon Ruderich Date: Tue, 8 Dec 2015 09:23:44 +0000 (+0100) Subject: import-certs.sh: simplify expiry check X-Git-Tag: v0.1.0~159 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d322e072d643dcee63785be1742a56a8178f74c0;p=thirdparty%2Fdehydrated.git import-certs.sh: simplify expiry check --- diff --git a/import-certs.sh b/import-certs.sh index a9cfa20..d80d3f5 100755 --- a/import-certs.sh +++ b/import-certs.sh @@ -48,8 +48,7 @@ for certdir in "${LETSENCRYPT}/live/"*; do fi # Check if certificate still valid - set +e; openssl x509 -checkend 0 -noout -in "${certdir}/cert.pem" > /dev/null 2> /dev/null; expired="${?}"; set -e - if [[ "${expired}" = "1" ]]; then + if ! openssl x509 -checkend 0 -noout -in "${certdir}/cert.pem" >/dev/null 2>&1; then echo " + Skipping: Certificate is expired." continue fi