how to detect reboot or shutdown in a script

From: Dyer, Steve J. <Steve.Dyer_at_alcoa.com>
Date: Tue, 05 Nov 2002 17:08:49 -0500

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.
Received on Tue Nov 05 2002 - 22:09:29 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:43 NZDT