diff bin/ntstop @ 1:4d6502ffaa5e

Initial revision
author darius
date Sat, 06 Dec 1997 04:36:59 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bin/ntstop	Sat Dec 06 04:36:59 1997 +0000
@@ -0,0 +1,35 @@
+#!/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