Skip to content

Instantly share code, notes, and snippets.

@manelvf
Created March 7, 2012 18:08
Show Gist options
  • Save manelvf/1994731 to your computer and use it in GitHub Desktop.
Save manelvf/1994731 to your computer and use it in GitHub Desktop.
Script to check for changes in log
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