Last active
December 26, 2015 18:49
-
-
Save carpodaster/7196906 to your computer and use it in GitHub Desktop.
Periodically checking for CRL validity w/ Event Girl integration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
CRLFILE=/root/certs/crl/crl.pem | |
DAYS=14 | |
EVENT_GIRL_SITE=https://event-girl.herokuapp.com | |
EVENT_GIRL_TOKEN=myeventgirlaccesstoken | |
source /usr/local/rvm/environments/ruby-2.0.0-p247 | |
eg_send() { | |
event_girl -s $EVENT_GIRL_SITE -t $EVENT_GIRL_TOKEN "$1" | |
} | |
crlwatch --file $CRLFILE --days $DAYS >/dev/null | |
rc=$? | |
if [[ $rc != 0 ]] | |
then | |
eg_send "CRLwatch - CRL will expire soon" | |
fi | |
STATUS_MSG='CRLwatch - CRL checked' | |
eg_send "$STATUS_MSG" && logger $STATUS_MSG |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment