Skip to content

Instantly share code, notes, and snippets.

@dhgwilliam
Created August 13, 2012 19:23
Show Gist options
  • Save dhgwilliam/3343455 to your computer and use it in GitHub Desktop.
Save dhgwilliam/3343455 to your computer and use it in GitHub Desktop.
#!/bin/bash
NEW='/tmp/certlist.new'
OLD='/tmp/certlist.old'
touch $NEW $OLD
puppet cert list --all > $NEW
NEWHASH=`md5sum $NEW | cut -f1 -d " " `
OLDHASH=`md5sum $OLD | cut -f1 -d " " `
if [ "$NEWHASH" != "$OLDHASH" ]
then
DIFF=`diff $NEW $OLD`
cp $NEW $OLD
fi
echo $DIFF | mailx -s "New cert request" -E test@test.test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment