Created
February 8, 2014 01:02
-
-
Save leblanc-simon/8875057 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
directory="/var/www/" | |
result="${directory}website-integrity/`date '+%Y-%m-%d'`.md5sum" | |
old_result="${directory}website-integrity/`date '+%Y-%m-%d' --date '1 days ago'`.md5sum" | |
website_directory="${directory}httpdocs/" | |
find ${website_directory} -type f -exec md5sum {} \; > ${result} | |
today=`md5sum ${result} | awk '{print $1}'` | |
yesterday=`md5sum ${old_result} | awk '{print $1}'` | |
if [ "${today}" != "${yesterday}" ]; then | |
echo "Bad luck" | |
echo "Il y a une difference entre le site d'hier et celui d'aujourd'hui : voir ${result} et ${old_result}" | mail -s "hack potentiel" [email protected] | |
exit 1 | |
else | |
echo "Yeah !" | |
exit 0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment