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

group="uucp"
mode="666"

device="/dev/ttyS14"

./ltuninst > /dev/null 2>/dev/null

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

	echo "/sbin/insmod -f ltmodem" >> /etc/rc.d/rc.local
	echo "/sbin/insmod -f ltserial" >> /etc/rc.d/rc.local
else
	if [ "-e /lib/modules/`uname -r`/kernel/drivers" ]
	then
		cp ltmodem.o /lib/modules/`uname -r`/kernel/drivers/
		cp ltserial.o /lib/modules/`uname -r`/kernel/drivers/

		echo "/sbin/insmod -f /lib/modules/`uname -r`/kernel/drivers/ltmodem.o" >> /etc/rc.d/rc.local
		echo "/sbin/insmod -f /lib/modules/`uname -r`/kernel/drivers/ltserial.o" >> /etc/rc.d/rc.local
	fi
fi
	
rm -f $device

mknod $device c 62 78

rm -f /dev/modem

ln -s $device /dev/modem

chgrp $group $device
chmod $mode $device

# uncomment the following two lines to have the EEPROM functionality enabled
#cp ltmdmapp /sbin/
#chmod +x /sbin/ltmdmapp

#cp lthomol.ini /sbin/ > /dev/null 2>/dev/null

/sbin/insmod -f ./ltmodem.o
/sbin/insmod -f ./ltserial.o

