1
0
Fork 0

script_refresh-proxied-certs: check expiry dates

This commit is contained in:
Chl 2019-10-02 02:20:14 +02:00
parent 5cafdd98bb
commit ed26706790

View file

@ -43,6 +43,12 @@ for i in *.crt; do
fi fi
fi fi
fi fi
# While we are at it, let's check the expiry dates
if [ "$( date --date="$( openssl x509 -noout -dates -in "$i" | sed -n '/^notAfter/s/^notAfter=//p' )" +%s )" -lt "$(( $( date +%s ) + 86400 ))" ]; then
echo "WARNING: certificate '$i' near or already expired." >&2
EXIT_STATUS=1
fi
done done
# Cleanup and exit # Cleanup and exit