how to detect reboot or shutdown in a script

From: Dyer, Steve J. (Steve.Dyer@alcoa.com)
Date: Tue Nov 05 2002 - 17:08:49 EST


We are using Tru64 v5.1A and have this issue:

We have a script that may be run either by hand or through the normal
startup process (linked into rc3.d). The script uses both the "stop" and
"start" arguments. Within that script, is there way to detect whether it was
run directly by the root account as opposed to being run as a result of a
reboot or a shutdown ? I am able to tell the difference on the "start" path
by using the LOGINNAME variable. I'm not sure how to do this on the "stop"
path.

Thanks,

Steve Dyer
ALCOA, Inc.



This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:48:58 EDT