#! /bin/sh
#
# DipKill	This shell script shuts down DipEye.
#
# Version:	@(#)/usr/sbin/dipeye	0.10	08/28/94
#
# Author:	Adam Dace, <glide@mcs.net>

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

# 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 the ping process...
PID=`ps ax | grep "/bin/ping -i 180 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.
echo -n "Manual DIP Shutdown:			" >> $DIP_LOG
date >> $DIP_LOG
