summaryrefslogtreecommitdiff
path: root/dahdi.init
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2008-07-08 21:10:02 +0000
committerShaun Ruffell <sruffell@digium.com>2008-07-08 21:10:02 +0000
commite88502949fd8cbe7edf37dd76c2b2c2286a88ff8 (patch)
tree62a7123b93f02aa63b2aa6993696cf7d7f85b0eb /dahdi.init
parent23bc24e215ce8d6759595e5c3ae65785004739dd (diff)
- Renamed init.conf to init.conf.sample
- Added /etc/dahdi/modules file that contains comments or the names of modules to load. - Removed the MODULES variable from /etc/dahdi/init.conf. git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@4578 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'dahdi.init')
-rwxr-xr-xdahdi.init39
1 files changed, 22 insertions, 17 deletions
diff --git a/dahdi.init b/dahdi.init
index 5d73bbc..c73d537 100755
--- a/dahdi.init
+++ b/dahdi.init
@@ -148,21 +148,27 @@ RETVAL=0
# See how we were called.
case "$1" in
start)
- # Load drivers
- if [ -z $MODULES ]; then
- echo "There aren't any DAHDI hardware modules specified to "
- echo "load. Please update /etc/dahdi/init.conf in order to "
- echo "specify the modules to load."
- exit 1
- fi
- echo -n "Loading DAHDI hardware modules:"
- for x in $MODULES; do
- eval localARGS="\$${x}_ARGS"
- if modprobe ${x} ${localARGS} 2> /dev/null; then
- echo -n " $x"
- echo "."
+ MODULES=""
+ cat "/etc/dahdi/modules" | grep "^[^\#]" | {
+ foundone=false
+ echo -ne $"Loading DAHDI hardware modules:\n"
+ while read line; do
+ foundone=true
+ echo -ne $" ${line}..."
+ if ! modprobe $line 2> /dev/null; then
+ echo -ne $"ERROR\n"
+ else
+ echo -ne $"DONE\n"
+ fi
+ done
+ echo -ne $"\n"
+ if ! $foundone; then
+ echo "There aren't any DAHDI hardware modules specified to "
+ echo "load. Please update /etc/dahdi/modules in order to "
+ echo "specify the modules to load."
+ exit 1
fi
- done
+ }
TMOUT=$DAHDI_DEV_TIMEOUT # max secs to wait
while [ ! -d /dev/dahdi ] ; do
sleep 1
@@ -204,11 +210,10 @@ case "$1" in
stop)
# Unload drivers
#shutdown_dynamic # FIXME: needs test from someone with dynamic spans
- echo -n "Unloading DAHDI hardware drivers:"
+ echo -ne $"Unloading DAHDI hardware drivers:"
unload_module dahdi
RETVAL=$?
- echo "."
-
+ echo -ne $" DONE\n"
if [ "$LOCKFILE" != '' ]; then
[ $RETVAL -eq 0 ] && rm -f $LOCKFILE
fi