aboutsummaryrefslogtreecommitdiffstats
path: root/comms/cdce/pkg-deinstall
diff options
context:
space:
mode:
Diffstat (limited to 'comms/cdce/pkg-deinstall')
-rw-r--r--comms/cdce/pkg-deinstall23
1 files changed, 23 insertions, 0 deletions
diff --git a/comms/cdce/pkg-deinstall b/comms/cdce/pkg-deinstall
new file mode 100644
index 000000000000..efa2236ae7fc
--- /dev/null
+++ b/comms/cdce/pkg-deinstall
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# Unload cdce kernel module if necessary
+#
+# $FreeBSD$
+#
+
+if [ "x$2" != "xDEINSTALL" ]; then
+ exit 0
+fi
+
+echo "Disabling if_cdce."
+
+# Unload if_cdce kernel module
+kldstat -n if_cdce 2>/dev/null >/dev/null && kldunload if_cdce
+
+# Remove kernel module
+if [ `sysctl -n kern.osreldate` -ge 500000 ]; then
+ KMODDIR="/boot/modules"
+else
+ KMODDIR="/modules"
+fi
+[ -f ${KMODDIR}/if_cdce.ko ] && rm -f ${KMODDIR}/if_cdce.ko