#! /bin/bash
log=/var/log/mythtv/hulu_grabber.log
out=/var/tmp/huludata.xml
rm -f $log
echo "Start on `date`" >>$log 2>&1
/usr/local/bin/gethulu.pl $out.new >>$log 2>&1
stat=$?
if [ $stat -ne 0 ]; then
  echo "Bad status $stat from gethulu.pl" >>$log 2>&1
  exit 1
fi
rm -f $out.old
mv $out $out.old
mv $out.new $out
echo "Done on `date`" >>$log 2>&1
ls -lh $out >>$log 2>&1