It should be fairly simple in fact :-)
Start with something like this:
$W = `who`
Which will place the list of logged in users in $W
Then you can use something like
echo $W | wc -l - 

To determine the number of lines in the output, (check the ABSG to
construct a nice if). If the number is 0 then run do:
sleep 600
Repeat the test, if it is still 0, run a shutdown. If not, exit.

Since cron runs your script in the background, you can merely sleep for
600 seconds and recheck to handle your ten minute check.

That should get you started.

A.J.


On Mon, 2003-07-07 at 05:33, Sudev Barar wrote:
> I have a setup where the server is shutdown on Saturday evening using
> crontab at a particular time. This allows some people to be able to work
> after hours without my / other admin to do a manual shutdown.
> I am wondering if it is possible to detect last logoff and initiate
> shutdown after say ten minutes of this. This script will be started by
> crontab on Saturday evening and will watch login status till last logoff
> and then start shutdown.
> Any pointers will be helpful.
-- 
"I don't support Linux because it is free.
I support it because it is good."
A.J. Venter
DireqLearn Linux Guru



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_____________________________________________________________________
Ltsp-discuss mailing list.   To un-subscribe, or change prefs, goto:
      https://lists.sourceforge.net/lists/listinfo/ltsp-discuss
For additional LTSP help,   try #ltsp channel on irc.freenode.net

Reply via email to