[mythtv] Ticket #3176: mythshutdown "Set Scheduled Wakeup Time" and "Detect Recording in Progress"

Matthew Wire devel at mrwire.co.uk
Wed Mar 7 16:52:40 UTC 2007


See: http://svn.mythtv.org/trac/ticket/3176

This patch modifies mythshutdown so it can be used to shutdown the
machine immediately, after performing checks for in-progress recordings
and setting the wakeup time for the next recording.

Changes

-s/--status - An additional return value of 8 specifies that a recording
is in progress.

Two new command-line parameters are available:

-t/--setscheduledwakeuptime - Gets the next scheduled recording and sets
the wakeup time using the command specified in MythWelcome/MythShutdown?
wakup command settings.

-x/--safeshutdown - equivalent to -c -t -q. This checks there is no
recording in progress, sets the wakeup time for the next scheduled
recording and shuts down the machine if everything completed
successfully.

Use Cases:
1. Scripts want to quickly check if a recording is in progress:
mythshutdown -s returns 8 if a recording is in progress.

2. Scripts want to set wakeup time for next scheduled recording.
mythshutdown -t interrogates scheduler and places wakeup time in
MythShutdownNextScheduled?.

3. Shutdown scripts - for example ACPI power button press, remote
control power button press.
In most cases here the desired behaviour would be to shutdown the
machine. However, 
a) If there is a recording in progress the user would probably want the
recording to continue.
b) The user would probably want the box to wake up in time for the next
recording.

By using mythshutdown -x for these actions it will automatically check
if a recording is in progress, get the scheduled wakeup time and
shutdown the machine if successful.




More information about the mythtv-dev mailing list