diff options
author | Sergey Yershov <syershov@maps.me> | 2019-04-26 12:58:22 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-26 12:58:22 +0300 |
commit | 3641d0a4afaa473713a2950c16162df6aca36bc8 (patch) | |
tree | cb7dd6d73ff7dd0604241ca7a92b798433a6b4b2 /tools | |
parent | 10ce023bd37b13010504159618c31ab6a33977d1 (diff) | |
parent | 95b3528308762676393dd10d3df7b48788f7f28a (diff) |
Merge pull request #10788 from ToshUxanoff/certificate-check
[tools] add 3-month error in check mode
Diffstat (limited to 'tools')
-rw-r--r-- | tools/unix/check_cert.sh | 9 |
1 files 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 |