summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdahdi.init14
-rw-r--r--init.conf.sample5
2 files changed, 17 insertions, 2 deletions
diff --git a/dahdi.init b/dahdi.init
index cbc9dc7..91ae44e 100755
--- a/dahdi.init
+++ b/dahdi.init
@@ -37,6 +37,10 @@ XPP_SYNC=auto
# device nodes after the modules have loaded and before running dahdi_cfg.
DAHDI_DEV_TIMEOUT=20
+# A list of modules to unload when stopping.
+# All of their dependencies will be unloaded as well.
+DAHDI_UNLOAD_MODULES="dahdi"
+
#
# Determine which kind of configuration we're using
#
@@ -99,6 +103,12 @@ unload_module() {
rmmod $module
}
+unload_modules() {
+ for module in $DAHDI_UNLOAD_MODULES; do
+ unload_module $module
+ done
+}
+
# In (xpp) hotplug mode, the init script is also executed from the
# hotplug hook. In that case it should not attempt to loade modules.
#
@@ -275,7 +285,7 @@ case "$1" in
# Unload drivers
#shutdown_dynamic # FIXME: needs test from someone with dynamic spans
echo -n "Unloading DAHDI hardware modules: "
- if unload_module dahdi; then
+ if unload_modules; then
echo "done"
else
echo "error"
@@ -285,7 +295,7 @@ case "$1" in
fi
;;
unload)
- unload_module dahdi
+ unload_modules
;;
restart|force-reload)
$0 stop
diff --git a/init.conf.sample b/init.conf.sample
index 9fb6393..58edec5 100644
--- a/init.conf.sample
+++ b/init.conf.sample
@@ -8,6 +8,11 @@
# device nodes after the modules have loaded and before running dahdi_cfg.
#DAHDI_DEV_TIMEOUT=40
+# A list of modules to unload when stopping.
+# All of their dependencies will be unloaded as well.
+#DAHDI_UNLOAD_MODULES="" # Disable module unloading
+#DAHDI_UNLOAD_MODULES="dahdi echo" # If you use OSLEC
+
# Override settings for xpp_fxloader
#XPP_FIRMWARE_DIR=/usr/share/dahdi
#XPP_HOTPLUG_DISABLED=yes