Difference between revisions of "Mythshutdown"

From MythTV Official Wiki
Jump to: navigation, search
(Added link to Mythwelcome page, which documents mythshutdown better than this page)
m (Using mythshutdown to block shutdown)
Line 1: Line 1:
 
{{Incomplete}}
 
{{Incomplete}}
 
=== Using mythshutdown to block shutdown ===
 
=== Using mythshutdown to block shutdown ===
Mythshutdown can be used to block an automatic shutdown.  Since 0.21 it is possible to call mythshutdown --lock for each script so that shutdown will remain blocked until the last script has terminated and called mythshutdown --unlock.
+
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.
  
 
{{Code box|script.sh|<pre>
 
{{Code box|script.sh|<pre>

Revision as of 16:19, 5 November 2008

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.