Subject: Re: ATX Smart Power Supplies
To: None <darcy@druid.net>
From: Phil Nelson <phil@cs.wwu.edu>
List: current-users
Date: 08/22/1998 08:14:51
>If you instead create a halt program that only runs if the tty is the
>console (or, better yet, check /etc/ttys to see if tty is secure) then

Something similar to the .xsession listed below.  This worked from xdm
but not from a standard login.  

#!/bin/sh

PATH=/bin:/usr/bin:/sbin

if [ `ps aux | grep -v ^root | grep -v ^USER | grep -v ^shutdown | wc -l` -gt 0; then
# Someone is on .... give them time ....
shutdown -r +1
xmessage "Someone is using the machine.  Shutdown in 1 minute..."
else
# Nobody is on .... do it now
shutdown -r now
fi


-- 
Phil Nelson                    NetBSD: http://www.netbsd.org
e-mail: phil@cs.wwu.edu        !gifs: http://www.gnu.org/philosophy/gif.html
http://www.cs.wwu.edu/~phil