Cover V04, I06
Article
Listing 1

nov95.tar


Listing 1: rebootsys Script

:
#       rebootsys
#
#       Check for a set of programs that might be running.  If
#       they aren't running, reboot the system.
#
#       Copyright, 1993 by Lawrence S Reznick

PROGS="menum|menuo|closeday|nightrun|uucico|ctar"
BOOTPROG="/etc/reboot"
SYSNAME=`/bin/uname`

/bin/ps -e | /usr/bin/egrep "$PROGS" > /dev/null

if [ $? = 0 ]
then
mail -s "Can't reboot $SYSNAME" siteadmin << alldone
Attempted to reboot $SYSNAME but found one of
"$PROGS"
was still running.

Notice the date & time of this mail message.  Will try again.
alldone

exit 1
fi

$BOOTPROG

exit 0