<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.18.2">
</HEAD>
<BODY>
I have the need to setup a Myth box with automatic shutdown and startup. I can handle the ACPI setup, I can get it to turn on in time to tape the show and then shutdown again but I would like a way (other than having a frontend running) to prevent the system from shutting down.<BR>
<BR>
I need this because in addition to being a Mythbox, this will also be a personal computer for internet, word processing, the occasional game, etc.<BR>
What I was thinking was that if the system was at the login screen then it can shutdown. If the system is logged in (even if a front end is not running) then it wont automatically shutdown. The idea would be that the user would not shutdown their PC but instead when they are finished with it they would just log out leaving the PC to decide if it can shutdown.<BR>
<BR>
I have not learnt how to write scripts yet, and I imagine that this is what I will need to do. Could someone please let me know how to modify the following script from <A HREF="https://help.ubuntu.com/community/MythTV/Install/WhatNext/ACPIWake">https://help.ubuntu.com/community/MythTV/Install/WhatNext/ACPIWake</A> to achieve what I have outlined above?<BR>
Thanks in advance,<BR>
Glen<BR>
<BR>
<BR>
#
<PRE>
# MythShutdownCheck
#
# checks to see if any other user is
# logged in before idle shutdown
#
# returns &quot;1&quot; if yes, stopping shutdown
# returns &quot;0&quot; if ok to shutdown
#

if last | head | grep -q &quot;pts/.*still logged in&quot;   # check for active *remote* login?

then
   exit 1

else
   exit 0
fi
</PRE>
</BODY>
</HTML>