#!/bin/sh
#
# DipKill	This shell script shuts down DipEye.
#
# Version:	@(#)/usr/local/bin/dipeye	0.30	11/01/94
#
# Author:	Adam Dace, <glide@mcs.com>

# Default files.
DIP_LOG="/var/adm/dipeye.log"
SPARE_VT="/dev/tty11"

# First kill dipeye.
PID=`ps ax | grep "sh /home/thekind/bin/dipeye" | grep -v grep | cut -c -5`
if [ "X${PID}" != "X" ]
then
  kill ${PID}
fi

# Now unmount my NFS-mounted filesystems...
/bin/umount /wuarchive &> /dev/null
/bin/umount /ais_net &> /dev/null

# Now the ping process...
#PID=`ps ax | grep "/bin/ping -i 300 chigate-1.mcs.com" | grep -v grep | cut -c -5`
#if [ "X${PID}" != "X" ]
#then
#  kill ${PID}
#fi

# And last, but not least, the dip process itself.
PID=`ps ax | grep "/sbin dip /home/thekind/bin/mcs.dip" | grep -v grep | cut -c -5`
if [ "X${PID}" != "X" ]
then
  kill ${PID}
fi

# Log manual shutdown to dipeye's logfile/spare vt
echo -n "Manual DIP Shutdown:				" >> $DIP_LOG
date >> $DIP_LOG
echo -n "Manual DIP Shutdown:				" >> $SPARE_VT
date >> $SPARE_VT
