> just fire a crontab entry and move on

actually, that's a great idea, I just scheduled the following script
this mails the diff of errata.html, but only if something changed

#!/bin/sh
rel="44" # OpenBSD version

ftp http://www.openbsd.org/errata"$rel".html > /dev/null 2>&1
if [ "$?" != "0" ]; then
   echo "Unable to fetch errata page!"
   exit 1
fi

if [ ! -f .errata"$rel".old ]; then
   touch .errata"$rel".old
fi

mv errata"$rel".html .errata"$rel".new
diff -u .errata"$rel".old .errata"$rel".new > .errata"$rel".diff
if [ "$?" = "1" ]; then
   cat .errata"$rel".diff | mail -s "OpenBSD$rel errata changed" root
   rm .errata"$rel".old > /dev/null 2>&1
   mv .errata"$rel".new .errata"$rel".old
fi

exit 0

Reply via email to