[mythtv-users] Notification of conflicts

Tom Lichti redpepperracing at gmail.com
Mon Sep 14 17:19:49 UTC 2009


On Mon, Sep 14, 2009 at 1:11 PM, Andrew Allison
<andrew.allison at gmail.com> wrote:
> On Sun, 2009-09-13 at 07:43 -0700, Steve Heistand wrote:
>> Richard Morton <richard.e.morton at gmail.com>, said on Sun Sep 13, 2009 [03:21:17 PM]:
>> } Hi,
>> }
>> } Now the Mythbox has come into very regular use with the other half,
>> } the number of programmes being recorded has trebled and so we're now
>> } getting conflicts.
>> }
>> } Is there a script, plugin or option for Myth that notifies you (via
>> } email?) of a conflict. This app could be triggered on each new
>> } recording schedule modification / schedule update so that you're
>> } notified each time the scheduling information changes, or on a crontab
>> } task.
>> }
>> } A simple email with links into mythweb to show the conflict issue
>> } would be nice; but a notification that there are conflicts to review
>> } would be sufficient.
>> }
>> } If it doesn't exist I would be interested in writing something like
>> } this however; Although it shouldnt be too hard to create something
>> } like this in php or python I know the scheduling engine is quite
>> } complex so I doubt a simple SQL query would be sufficient.
>> }
>> } So does this sort of thing already exist?
>> }
>> } thanks
>> }
>> } Rich
>> } _______________________________________________
>>
>>
>> I run this once a day from cron:
>>
>> #!/bin/csh
>>
>> set result=`/usr/local/src/myth_trunk/mythtv/contrib/info/misc_status_info/myth_upcoming_recordings.pl --recordings -1 --no_show_scheduled --plain_text --heading '<h3>Recording Conflicts</h3>' `
>> #                           --no_conflicts_message 'No\n' `
>>
>> if ( "$result" != "No conflicts." ) then
>>   echo "$result" | Mail -s "Mythtv recording conflict" heistand >& /dev/null
>> endif
>>
> This got me to thinking.
>
> I've dug out one of my old script files and come up with this.
> Problem is I can't get the report into the message body,so I've had to
> stick into the subject line.
>
> Can anybody spot what I've done wrong to get the report into the message
> body.
>
> I've sanitized the user name and email domains and echo (echo "HELO is
> one continuous line.
>
>
> !/bin/bash
> result=`/usr/share/doc/mythtv-docs-0.21/contrib/misc_status_info/myth_upcoming_recordings.pl --recordings -1 --no_show_scheduled --plain_text --heading '<h3>Recording Conflicts</h3>'`
>
> if [ "$result" != "No conflicts." ]
> then
>    echo "Conflict"
>    rm /home/mythtv/conflict.report
> #
>    echo -n "Date:" > /home/mythtv/conflict.report
>    /bin/date >> /home/mythtv/conflict.report
>    echo "From:user at domain.com" >> /home/mythtv/conflict.report
>    echo "To:user at domain.com"   >> /home/mythtv/conflict.report
>    echo -n "Subject:Mythtv Conflict"  >> /home/mythtv/conflict.report
>    echo $result >> /home/mythtv/conflict.report
>    (echo "HELO domain.com"; sleep 2; echo "MAIL From:user at domain.com";
> sleep 2; echo "RCPT To:user at domain.com"; sleep 2; echo "DATA"; sleep
> 2; /bin/cat /home/mythtv/conflict.report; sleep 2; echo "."; sleep 2;
> echo "QUIT"; sleep 2; ) | telnet smtp.domain.com 25
> fi

Wouldn't it just be easier to install the mail command?

Regardless, this should work better:

(echo "HELO domain.com"; sleep 2; echo "MAIL From:user at domain.com";
sleep 2; echo "RCPT To:user at domain.com"; sleep 2; echo "DATA"; sleep
2; echo "Subject: MythTV recording conflict" ; sleep 2 ; echo "From:
user at domain.com" ; sleep 2 ; echo "To: user at domain.com" ; sleep 2 ;
/bin/cat /home/mythtv/conflict.report; sleep 2; echo "."; sleep 2;
echo "QUIT"; sleep 2; )

Tom


More information about the mythtv-users mailing list