#	/*name and version number: @(#)ltuninst	1.9*/
#	/*date of get:             11/24/03  14:46:49 */
#	/*date of delta:           01/31/01  17:13:42 */
#===========================================================================
#       File Name :     ltuninst
#
# Copyright (C) 1999, 2000, 2001 Lucent Technologies Inc.
# Copyright (C) 2001, 2002, 2003 Agere Systems Inc. All rights reserved.
#
# Description:
#  This script uninstalls the Lucent WinModem driver modules.
#===========================================================================
#!/bin/sh

/sbin/rmmod ltserial
/sbin/rmmod ltmodem

rm -f /dev/ttyS14

rm -f /dev/modem

KERNELMAJ=`uname -r | sed                   -e 's,\..*,,'`
KERNELMIN=`uname -r | sed -e 's,[^\.]*\.,,' -e 's,\..*,,'`
if [ "$KERNELMAJ" -eq 2 -a "$KERNELMIN" -lt 4 ]
then
	rm -f /lib/modules/`uname -r`/misc/ltserial.o
	rm -f /lib/modules/`uname -r`/misc/ltmodem.o
else
	if [ "-e /lib/modules/`uname -r`/kernel/drivers/ltserial.o" ]
	then
		rm -f /lib/modules/`uname -r`/kernel/drivers/ltserial.o
		rm -f /lib/modules/`uname -r`/kernel/drivers/ltmodem.o
	fi
fi

# uncomment the following three lines if EEPROM functionality is enabled
#rm -f /sbin/ltmdmapp
#rm -f /sbin/lthomol.ini
#rm -f /sbin/lteeprom.dat

#remove the insmod line from rc.local
mv /etc/rc.d/rc.local /etc/rc.d/rc.local.ltbackup
grep -v "ltmodem" /etc/rc.d/rc.local.ltbackup > /etc/rc.d/rc.local.ltbackup2
grep -v "ltserial" /etc/rc.d/rc.local.ltbackup2 > /etc/rc.d/rc.local
rm -f /etc/rc.d/rc.local.ltbackup
rm -f /etc/rc.d/rc.local.ltbackup2
chmod 0755 /etc/rc.d/rc.local
