#!/bin/sh
#
#
#Copyright (C) 2004  Kenney He
#
#This program is free software; you can redistribute it and/or
#modify it under the terms of the GNU General Public License
#as published by the Free Software Foundation; either version 2
#of the License, or (at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with this program; if not, write to the Free Software
#Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#
#
#
# Remove script for the asa72xx module
#
RC_DIR=/etc/rc.d
KERNEL_VER=`uname -r`
KERNEL_SRC=/usr/src/linux
KERNEL_SRC_INC=/usr/src/linux/include/linux
KERNEL_SRC_RH71=/usr/src/linux-2.4
KERNEL_SRC_INC_RH71=/usr/src/linux-2.4/include/linux

echo "$0: Removing .... "

if [ -f $RC_DIR/rc3.d/S06asa72xx -a -f $RC_DIR/rc5.d/S06asa72xx ]
then
	echo "$0: Removing S06asa72xx from rc.d directory !" 
	rm -f $RC_DIR/rc3.d/S06asa72xx
	rm -f $RC_DIR/rc3.d/K06asa72xx
	rm -f $RC_DIR/rc5.d/S06asa72xx
	rm -f $RC_DIR/rc5.d/K06asa72xx
        rm -f /etc/init.d/asa72xx
else
	echo "$0: S06asa72xx does not exist in rc.d directory !"
fi

if [ -f /etc/asa72xx.conf ]
then
	echo "$0: Removing asa72xx.conf from /etc !" 
	rm -f /etc/asa72xx.conf
else
	echo "$0: asa72xx.conf does not exist in /etc directory !\n"
fi	

if [ -f /lib/modules/$KERNEL_VER/scsi/asa72xx.o ]
then
	echo "$0: Removing asa72xx.o from /lib/modules/$KERNEL_VER !" 
	rm -f /lib/modules/$KERNEL_VER/scsi/asa72xx.o
elif [ -f /lib/modules/$KERNEL_VER/kernel/drivers/scsi/asa72xx.o ]
then
	echo "$0: Removing asa72xx.o from /lib/modules/$KERNEL_VER !" 
	rm -f /lib/modules/$KERNEL_VER/kernel/drivers/scsi/asa72xx.o
else
	echo "$0: asa72xx.o does not exist in /lib/modules/$KERNEL_VER !"
fi
	
echo "$0: Done !"
exit 0
