No I don't mind sharing the script at all. I start it from /etc/rc.local with nohup. I hacked it together in a few minutes, so it isn't pretty, but here goes:
#!/bin/bash
MYLOGFILE="/root/mythtvBugCheck.log"
MYTHLOGFILNAME="mythbackend.log" MYTHLOGDIRNAME="/var/log/mythtv/"
OK_STRING="All is well" MARK_STRING="-- MARK --" BUGG_STRING="Warning: Recording will not commence until a PMT is set"
typeset -i cnt=0 typeset -i CNT_MAX=60
while (true) do cnt=`expr $cnt + 1`
grep "$BUGG_STRING" ${MYTHLOGDIRNAME}${MYTHLOGFILNAME} >/dev/null
if [[ $? -eq 0 ]]; then echo "`date '+%Y-%m-%d %H:%M:%S'`: Restart MythTV backend..." >> $MYLOGFILE /etc/init.d/mythtv-backend stop >> $MYLOGFILE 2>> $MYLOGFILE cp -p ${MYTHLOGDIRNAME}${MYTHLOGFILNAME} /tmp grep -v "$BUGG_STRING" /tmp/${MYTHLOGFILNAME} > ${MYTHLOGDIRNAME}${MYTHLOGFILNAME} /etc/init.d/mythtv-backend start >> $MYLOGFILE 2>> $MYLOGFILE else if [[ $cnt -ge $CNT_MAX ]]; then cnt=0 grep -v "$OK_STRING" $MYLOGFILE > ${MYLOGFILE}.$$ echo "`date '+%Y-%m-%d %H:%M:%S'`: $MARK_STRING" >> ${MYLOGFILE}.$$ mv ${MYLOGFILE}.$$ $MYLOGFILE else echo "`date '+%Y-%m-%d %H:%M:%S'`: ${OK_STRING}" >> $MYLOGFILE fi fi
sleep 60
done
No I don't mind sharing the script at all. I start it from /etc/rc.local with nohup. I hacked it together in a few minutes, so it isn't pretty, but here goes:
#!/bin/bash
MYLOGFILE= "/root/ mythtvBugCheck. log"
MYTHLOGFILNAME= "mythbackend. log" "/var/log/ mythtv/ "
MYTHLOGDIRNAME=
OK_STRING="All is well" "Warning: Recording will not commence until a PMT is set"
MARK_STRING="-- MARK --"
BUGG_STRING=
typeset -i cnt=0
typeset -i CNT_MAX=60
while (true)
do
cnt=`expr $cnt + 1`
grep "$BUGG_STRING" ${MYTHLOGDIRNAM E}${MYTHLOGFILN AME} >/dev/null
if [[ $? -eq 0 ]]; then etc/init. d/mythtv- backend stop >> $MYLOGFILE 2>> $MYLOGFILE E}${MYTHLOGFILN AME} /tmp MYTHLOGFILNAME} > ${MYTHLOGDIRNAM E}${MYTHLOGFILN AME} etc/init. d/mythtv- backend start >> $MYLOGFILE 2>> $MYLOGFILE
echo "`date '+%Y-%m-%d %H:%M:%S'`: Restart MythTV backend..." >> $MYLOGFILE
/
cp -p ${MYTHLOGDIRNAM
grep -v "$BUGG_STRING" /tmp/${
/
else
if [[ $cnt -ge $CNT_MAX ]]; then
cnt=0
grep -v "$OK_STRING" $MYLOGFILE > ${MYLOGFILE}.$$
echo "`date '+%Y-%m-%d %H:%M:%S'`: $MARK_STRING" >> ${MYLOGFILE}.$$
mv ${MYLOGFILE}.$$ $MYLOGFILE
else
echo "`date '+%Y-%m-%d %H:%M:%S'`: ${OK_STRING}" >> $MYLOGFILE
fi
fi
sleep 60
done