Commit d322e072 authored by Simon Ruderich's avatar Simon Ruderich

import-certs.sh: simplify expiry check

parent 526843d6
......@@ -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
......
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