Skip to content

Instantly share code, notes, and snippets.

@carpodaster
Last active December 26, 2015 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carpodaster/7196906 to your computer and use it in GitHub Desktop.
Save carpodaster/7196906 to your computer and use it in GitHub Desktop.
Periodically checking for CRL validity w/ Event Girl integration
#!/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