Mythshutdown

From MythTV Official Wiki
Revision as of 16:19, 5 November 2008 by Mlord (Talk | contribs)

Jump to: navigation, search

Incomplete.png 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.


Script.png script.sh
#!/bin/bash
# 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
/usr/local/bin/mythshutdown --lock

# Do script stuff

See, also, Mythwelcome.