view bin/ntstop @ 9:331055a97a9d

Initial revision
author darius
date Sat, 06 Dec 1997 04:37:05 +0000
parents 4d6502ffaa5e
children
line wrap: on
line source

#!/bin/sh
#
# shut down the server
#
# since we don't know who may execute this (if it is called from the system
# upon a machine shutdown, for instance), use ../directory notation
# rather than ${NETREKDIR}, assuming it is executed in ${NETREKDIR}/bin
#
# This will blast the daemon and listen process, it will NOT blast any
# ntserv processes (wait for them to disconnect or do these by hand)
#
# if an argument exists it is taken as the NETREKDIR
#

if [ X$1 != X ]; then
        NETREKDIR=$1
elif [ X${NETREKDIR} = X ]; then
        if [ -f "../etc/conf.netrekdir" ]; then
                NETREKDIR=`cat "../etc/conf.netrekdir"`
        else
                echo "No NETREKDIR variable found, exiting."
                exit 1
        fi
fi

SYSTEM=`hostname`

echo "" > /tmp/$$.ntstop
echo "${USER}@${SYSTEM}:    ******* IMMINENT SYSTEM SHUTDOWN! *******" >> /tmp/$$.ntstop
echo "${USER}@${SYSTEM}:    ******* IMMINENT SYSTEM SHUTDOWN! *******" >> /tmp/$$.ntstop
echo "" >> /tmp/$$.ntstop
${NETREKDIR}/bin/mes A -w < /tmp/$$.ntstop
rm /tmp/$$.ntstop
/bin/kill `cat ${NETREKDIR}/logs/listen.pid` 2> /dev/null
/bin/kill `cat ${NETREKDIR}/logs/daemonII.pid` 2> /dev/null