Incomplete, needs to be expanded. Please help to fill the gaps or discuss the issue on the talk page
Using Mythshutdown to block shutdown
Mythshutdown can be used to block an automatic shutdown. Since 0.21 it is possible to call mythshutdown --lock from each script so that shutdown will remain blocked until the last script has terminated and called mythshutdown --unlock.
# Unlock if the script is terminated for any reason
trap "/usr/local/bin/mythshutdown --unlock" 0 SIGHUP SIGINT SIGQUIT SIGABRT SIGKILL SIGALRM SIGSEGV SIGTERM
# Lock shutdown
# Do script stuff
The full command-line options are (taken from version 0.25.1 output):
-c OR --check Check whether shutdown is possible
--lock disable shutdown
-x OR --safeshutdown Check if shutdown is possible, and shutdown
-t OR --setscheduledwakeup Set wakeup time to the next scheduled recording
-w OR --setwakeup Set the wakeup time (yyyy-MM-ddThh:mm:ss)
-h OR --help OR --usage Display this help printout, or give detailed information of selected option.
--version Display version information.
--shutdown Apply wakeup time to nvram and shutdown.
-p OR --startup Check startup status
-s OR --status check current status
-u OR --unlock enable shutdown
--loglevel Set the logging level. All log messages at lower levels will be discarded.
In descending order: emerg, alert, crit, err, warning, notice, info, debug
defaults to info
--logpath Writes logging messages to a file in the directory logpath with filenames in the format: applicationName.date.pid.log.
This is typically used in combination with --daemon, and if used in combination with --pidfile, this can be used with log rotators, using the HUP call to inform MythTV to reload the file
--nodblog Disable database logging.
-q OR --quiet Don't log to the console (-q). Don't log anywhere (-q -q)
--syslog Set the syslog logging facility.
Set to "none" to disable, defaults to none.
-v OR --verbose Specify log filtering. Use '-v help' for level info.
See, also, Mythwelcome.