2020-03-17 16:47:45 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
module=module-name
|
|
|
|
version=x.x.x
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
case "$1" in
|
2020-04-14 13:25:02 +02:00
|
|
|
remove)
|
|
|
|
if [ "`dkms status -m $module`" ]
|
|
|
|
then
|
|
|
|
dkms remove -m $module -v $version --all
|
|
|
|
# Attempt to remove module, fail silently if module is already unloaded
|
|
|
|
rmmod -s $module > /dev/null 2>&1 || true
|
|
|
|
fi
|
|
|
|
rm -f /etc/modprobe.d/tuxedo_keyboard.conf || true
|
|
|
|
;;
|
|
|
|
|
|
|
|
upgrade|deconfigure)
|
2020-03-17 16:47:45 +01:00
|
|
|
if [ "`dkms status -m $module`" ]
|
|
|
|
then
|
|
|
|
dkms remove -m $module -v $version --all
|
|
|
|
# Attempt to remove module, fail silently if module is already unloaded
|
|
|
|
rmmod -s $module > /dev/null 2>&1 || true
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
failed-upgrade)
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
echo "prerm called with unknown argument \`$1'" >&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
|