From 95b3528308762676393dd10d3df7b48788f7f28a Mon Sep 17 00:00:00 2001 From: Ukhanov Anton Date: Fri, 26 Apr 2019 12:25:46 +0300 Subject: [PATCH] added 3-month error in check mode --- tools/unix/check_cert.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/unix/check_cert.sh b/tools/unix/check_cert.sh index 0d8a12e964..456660c8e7 100644 --- a/tools/unix/check_cert.sh +++ b/tools/unix/check_cert.sh @@ -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