[mythtv-users] Autostart frontend ONLY on manual startup?
Phill Edwards
philledwards at gmail.com
Tue Mar 8 12:37:12 UTC 2005
Here it is:
#!/bin/bash
#
# remote_chk.sh
# This script checks whether any keys have been pressed on the remote control
# in the TIMEOUT seconds since mythfrontend was started (this script is started
# when mythfrontend is from .ratpoisonrc). If there has been any presses then
# the frontend is assumed to be in use and so we don't want to shutdown
# mythfrontend. If there haven't been any key presses then assume that it's not
# in use so we kill mythfrontend (which is auto started on system startup) so
# that the auto shutdown processing can then go ahead.
PROG=mythfrontend
TIMEOUT=600
LOGF=/var/log/mythtv/irw.log
irw > $LOGF &
sleep $TIMEOUT
IRLOG=`cat $LOGF | wc -l | awk '{print $1}'`
#UNK=`cat $LOGF | grep unknown | grep -v grep | wc -l | awk '{print $1}'`
#if [ $IRLOG -eq 0 ] || [ $IRLOG == $UNK ]
if [ $IRLOG -eq 0 ]
then
echo "remote_chk.sh killing mythfrontend at `date`" >> /tmp/mythrestart.log
killall $PROG
fi
exit 0
More information about the mythtv-users
mailing list