mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-04-23 16:58:28 +02:00
simplify expiry check
This commit is contained in:
@@ -327,12 +327,10 @@ fi
|
|||||||
if [[ -e "${cert}" ]]; then
|
if [[ -e "${cert}" ]]; then
|
||||||
echo " + Found existing cert..."
|
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- )"
|
valid="$(openssl x509 -enddate -noout -in "${cert}" | cut -d= -f2- )"
|
||||||
|
|
||||||
echo -n " + Valid till ${valid} "
|
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!"
|
echo "(Longer than ${RENEW_DAYS} days). Skipping!"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user