]> oss.titaniummirror.com Git - cp210x.git/blobdiff - debian.in/prerm
dkms support in pre/post scripts. Ensure module is rmmod'ed on removal of pkg.
[cp210x.git] / debian.in / prerm
diff --git a/debian.in/prerm b/debian.in/prerm
new file mode 100755 (executable)
index 0000000..d685190
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+NAME=xxPACKAGExx
+VERSION=xxPKGVERxx
+
+set -e
+
+case "$1" in
+    remove|upgrade|deconfigure)
+      rmmod cp2101 2>/dev/null || true
+      rmmod xxROOTNAMExx 2>/dev/null || true
+      if [  "`dkms status -m $NAME`" ]; then
+         dkms remove -m $NAME -v $VERSION --all
+      fi
+    ;;
+
+    failed-upgrade)
+    ;;
+
+    *)
+        echo "prerm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0
+