Thanks. I think I will look into it. In the mean time, I was thinking this over, and I came up with a different solution. Instead of mailing from the TiVos, I created an Expect script to run on one of my servers. First, I created this simple script to put on the TiVos:
Code:
swversion:
#! /bin/bash
echo mls /SwSystem | tivosh
Then I created a simple Expect script on the server to run the software on the TiVos:
Code:
tivotest.exp:
#! /usr/bin/expect --
log_file session.txt
spawn telnet $argv
expect #
send swversion\n
expect #
sleep 2
log_file
send exit
In order to run the Expect script on all three TiVos I create a shell script:
Code:
tivoscan:
#! /bin/bash
dir=/usr/share/tivoscan
cd $dir
tivo=$dir/tivos.list
file=$dir/session.txt
log=/var/log/tivoscan.log
expfile=$dir/tivotest.exp
echo $(date +%Y-%m-%d_%H:%M:%S) Starting tivoscan session. >> $log
while read line
do
[ -f $file ] && rm $file
$expfile $line
active=$(grep ACTIVE $file | awk '{print $3;}')
swlines=$(grep tyDb $file | grep -v $active | wc -l)
if [ $swlines -gt 0 ];
then
echo "TiVo $line is ppending a software installation." | mail -a From:mdadm_monitor -s "RAID-Server TiVo Upgrade Notice" <email addresses>
echo $(date +%Y-%m-%d_%H:%M:%S) Emailing notification of pending software for $line. >> $log
fi
done < $tivo
[ -f $file ] && rm $file
echo $(date +%Y-%m-%d_%H:%M:%S) Tivoscan session complete. >> $log
I create a file to contain the hostnames of the TiVos:
Code:
tivos.list:
hd_livingroom
hd_theater
tivo_hd
And finally, I create a cron job to run the script every six hours:
Code:
0 */6 * * * root /usr/bin/tivoscan > /dev/null