]> git.ipfire.org Git - thirdparty/dehydrated.git/commitdiff
simplify expiry check
authorSimon Ruderich <simon@ruderich.org>
Tue, 8 Dec 2015 09:06:17 +0000 (10:06 +0100)
committerSimon Ruderich <simon@ruderich.org>
Tue, 8 Dec 2015 15:04:47 +0000 (16:04 +0100)
letsencrypt.sh

index 303a49976fdaf7a39408ab2ce983ef9d6b648400..16319140dae794dcf15e7fe3b59a3feab31259d7 100755 (executable)
@@ -327,12 +327,10 @@ fi
   if [[ -e "${cert}" ]]; then
     echo " + Found existing cert..."
 
-    # Turning off exit on non-zero status for cert validation
-    set +e; openssl x509 -checkend $((RENEW_DAYS * 86400)) -noout -in "${cert}"; expiring=$?; set -e
     valid="$(openssl x509 -enddate -noout -in "${cert}" | cut -d= -f2- )"
 
     echo -n " + Valid till ${valid} "
-    if [[ ${expiring} -eq 0 ]]; then
+    if openssl x509 -checkend $((RENEW_DAYS * 86400)) -noout -in "${cert}"; then
       echo "(Longer than ${RENEW_DAYS} days). Skipping!"
       continue
     fi