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 ...@@ -48,8 +48,7 @@ for certdir in "${LETSENCRYPT}/live/"*; do
fi fi
# Check if certificate still valid # 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 ! openssl x509 -checkend 0 -noout -in "${certdir}/cert.pem" >/dev/null 2>&1; then
if [[ "${expired}" = "1" ]]; then
echo " + Skipping: Certificate is expired." echo " + Skipping: Certificate is expired."
continue continue
fi 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