]> oss.titaniummirror.com Git - cp210x.git/blobdiff - debian.in/postrm
dkms support in pre/post scripts. Ensure module is rmmod'ed on removal of pkg.
[cp210x.git] / debian.in / postrm
index fdd7b35af60cda3b7e3fd628394ea0d59b842f52..9bf77b537947070fe2a117b70c5e964420741ed4 100755 (executable)
@@ -1,7 +1,26 @@
-#! /bin/sh
+#!/bin/sh
+
+NAME=xxPACKAGExx
+VERSION=xxPKGVERxx
 
 set -e
 
-if [ "$1" = "remove" ]; then
-       depmod -a
-fi
+case "$1" in
+    purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+      depmod
+      if [ -d "/usr/src/$NAME-$VERSION" ]; then
+         echo "Removing old module source..."
+         rm -rf "/usr/src/$NAME-$VERSION"
+      fi
+    ;;
+
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0
+