Created
March 7, 2012 18:08
-
-
Save manelvf/1994731 to your computer and use it in GitHub Desktop.
Script to check for changes in log
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
file1= "..." # old log file | |
file2= "..." # new log file | |
url= "..." | |
mail= "..." | |
rm ${file1} | |
mv ${file2} ${file1} | |
nice curl ${url} > ${file2} # execute process and write output in file2 | |
expr1=`md5sum ${file1}` | |
expr2=`md5sum ${file2}` | |
if [ "${expr1:0:32}" != "${expr2:0:32}" ] | |
then | |
sendmail "${mail}" < ${file2} | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment