[mythtv-users] simple shutdown script

Tim Plessers tplessers at tiscali.be
Thu Jul 27 11:19:42 UTC 2006


Hi,

My mythbox-BIOS is configured to auto-startup every day at 5pm.  I would 
like to create a cronjob-script that shuts down the box after 1 am, ONLY 
when no more recordings are scheduled untill 5pm (when it starts up 
again).  If recordings were found, it will do the check again after one 
hour, etc.  This way, I can save power consumption without manually 
shutting down the box every day.  Also, mplayer should not be running 
because I don't want the box to shutdown while I'm looking at a 
recording at 1am.  My backend and frontend are on the same machine.

Does such a script already exists, if so, where can I find it?  If not, 
please help me out :


pseudo-code (I know, I suck at writing scripts) :

#!/bin/bash
if ((mysql-command to count number of recordings till 5pm) == 0)
&& ((ps -ef | grep mplayer) returns nothing))
{
    shutdown -h now
}

Thanks for your input,

Tim Plessers


More information about the mythtv-users mailing list