tempfile=$HOME/mostemp

clear
echo " "
echo "-----------------------MCS7830 UNINSTALL SCRIPT------------------------"
#echo "---------------------FOR LINUX 2.6.11-1.1369_FC4-----------------------"
echo " "


if (ls /lib/modules/`uname -r`/kernel/drivers/usb/serial/moschip/mcs7830.ko 2>/dev/null) then
	rm -rf /lib/modules/`uname -r`/kernel/drivers/usb/serial/moschip/mcs7830.ko
        echo "MOS_UNINSTALL : mcs7830.ko removed "
	rmmod mcs7830
	more /etc/rc.local | grep -v "insmod /lib/modules/`uname -r`/kernel/drivers/usb/serial/moschip/mcs7830.ko" > $tempfile
	cp $tempfile /etc/rc.local
	rm -f $tempfile

else
        echo "MOS_UNINSTALL Failed: mcs7830.ko File doesn't exists"
fi

echo " "
echo "-----------------------Thanks for using MCS7830 Driver-------------------"
echo " "
