script_refresh-proxied-certs: check expiry dates
This commit is contained in:
parent
5cafdd98bb
commit
ed26706790
1 changed files with 6 additions and 0 deletions
|
@ -43,6 +43,12 @@ for i in *.crt; do
|
|||
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
|
||||
|
||||
# Cleanup and exit
|
||||
|
|
Loading…
Reference in a new issue