campo-sirio/linux/eutron/skuninstall

38 lines
816 B
Plaintext
Raw Normal View History

#!/bin/bash
VERSION=`uname -r`
# Set execute permission
chmod a+x skinstall skuninstall smartdem skeyver error-report
# Remove devices
[ -r /dev/skey0 ] && rm -f /dev/skey0
[ -r /dev/skey1 ] && rm -f /dev/skey1
[ -r /dev/skey2 ] && rm -f /dev/skey2
# Remove the module
[ -r /lib/modules/$VERSION/misc/skey.o ] && rm -f /lib/modules/$VERSION/misc/skey.o
# Remove alias for the module
if [ -e /etc/modules.conf ] ; then
CONFMODULES=/etc/modules.conf
else
CONFMODULES=/etc/conf.modules
fi
cp $CONFMODULES $CONFMODULES.orig
cat $CONFMODULES.orig | grep -v "char-major-59" > $CONFMODULES
# Remove the loaded module
(lsmod | grep skey > /dev/null) && rmmod skey
# Run depmod
echo Updating modules dependencies
if ! depmod -a ; then
echo Error running depmod
exit 1
fi
echo SmartKey driver uninstalled
exit 0