Merge pull request #10788 from ToshUxanoff/certificate-check

[tools] add 3-month error in check mode
This commit is contained in:
Sergey Yershov 2019-04-26 12:58:22 +03:00 committed by GitHub
commit 3641d0a4af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,8 +42,13 @@ else
cert_end_timestamp=`LANG=C LC_ALL=C date --date "$mon $day $year $time $tz" +%s`
fi
if [[ "$MODE" == "check" ]]; then
if [[ "$warning_timestamp" -gt "$cert_end_timestamp" ]]; then
echo "Our client certificate end date of $mon $day $time $year $tz is within ${MONTHS_BEFORE_EXPIRATION_TO_BREAK} month {DAYS_WARNING_INTERVAL} days from now."
if [[ "$threshold_timestamp" -gt "$cert_end_timestamp" ]]; then
echo "Our client certificate end date of $mon $day $time $year $tz is within $MONTHS_BEFORE_EXPIRATION_TO_BREAK months from now."
echo "Update this certificate immediately!"
echo "Error"
exit 1
elif [[ "$warning_timestamp" -gt "$cert_end_timestamp" ]]; then
echo "Our client certificate end date of $mon $day $time $year $tz is within ${MONTHS_BEFORE_EXPIRATION_TO_BREAK} month ${DAYS_WARNING_INTERVAL} days from now."
echo "Update this certificate!"
echo "Warning"
exit 1