summaryrefslogtreecommitdiff
path: root/build_tools
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-12-11 08:50:21 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-12-11 08:50:21 +0000
commitd76d45ef2dbf5c8e51bcb90d1549cd7da147b148 (patch)
tree2790227189516b755bb2040a1776e9b133ed4074 /build_tools
parent1377543d84271c473e296b32676be4ab66631ac9 (diff)
uninstall-modules: put in build_tools, and remove language suffix.
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@3420 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'build_tools')
-rwxr-xr-xbuild_tools/uninstall-modules36
1 files changed, 36 insertions, 0 deletions
diff --git a/build_tools/uninstall-modules b/build_tools/uninstall-modules
new file mode 100755
index 0000000..d70255c
--- /dev/null
+++ b/build_tools/uninstall-modules
@@ -0,0 +1,36 @@
+#!/bin/sh
+# uninstall-modules-sh
+#
+# Remove all the modules passed in on the command line from the modules
+# directory. This script is called by the makefile.
+#
+# USAGE: uninstall-modules-sh <modules dir> modules to delete ...
+
+KERNEL_MODULES_DIR=$1
+shift
+MODULES=$@
+
+function usage {
+ echo "$0: Used to delete kernel modules from the modules directory."
+}
+
+if [ -z "$KERNEL_MODULES_DIR" ]; then
+ echo "Missing kernel module directory."
+ usage
+ exit 1;
+fi
+
+if [ -z "$MODULES" ]; then
+ echo "Missing one or more modules to delete."
+ usage
+ exit 1;
+fi
+for mod in $MODULES; do
+ for file in `cat $KERNEL_MODULES_DIR/modules.dep | cut -d : -f 1 | grep $mod`; do
+ if [ -e "$file" ]; then
+ echo "Deleting $file."
+ rm -f $file
+ fi
+ done
+done
+exit 0