summaryrefslogtreecommitdiff
path: root/dahdi.init
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2008-08-28 21:40:23 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2008-08-28 21:40:23 +0000
commitd414d9ee0e935592bfbf12e152d2d6ab6abd3d6c (patch)
tree83e2506d35969d193c0ad9a39f7e6022da3c0057 /dahdi.init
parent3c6219fbb8a736a69e73709c58ba31166f241714 (diff)
Simplify reading list of modules from /etc/dahdi/modules .
git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@4855 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'dahdi.init')
-rwxr-xr-xdahdi.init41
1 files changed, 19 insertions, 22 deletions
diff --git a/dahdi.init b/dahdi.init
index e0bb6a7..79c6441 100755
--- a/dahdi.init
+++ b/dahdi.init
@@ -39,6 +39,8 @@ if [ $system = redhat ]; then
. $initdir/functions || exit 0
fi
+DAHDI_MODULES_FILE="/etc/dahdi/modules"
+
[ -r /etc/dahdi/init.conf ] && . /etc/dahdi/init.conf
if [ $system = redhat ]; then
@@ -148,30 +150,25 @@ RETVAL=0
# See how we were called.
case "$1" in
start)
- cat "/etc/dahdi/modules" | grep "^[^\#]" | {
- foundone=false
- echo "Loading DAHDI hardware modules:"
- while read line; do
- foundone=true
- if [ $system = debian ]; then
- echo -n " ${line}: "
- if modprobe $line 2> /dev/null; then
- echo -n "done"
- else
- echo -n "error"
- fi
- elif [ $system = redhat ]; then
- action " ${line}: " modprobe $line
+ modules=`sed -e 's/#.*$//' $DAHDI_MODULES_FILE 2>/dev/null`
+ #if [ "$modules" = '' ]; then
+ # what?
+ #fi
+ echo "Loading DAHDI hardware modules:"
+ modprobe dahdi
+ for line in $modules; do
+ if [ $system = debian ]; then
+ echo -n " ${line}: "
+ if modprobe $line 2> /dev/null; then
+ echo -n "done"
+ else
+ echo -n "error"
fi
- done
- echo ""
- 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
+ elif [ $system = redhat ]; then
+ action " ${line}: " modprobe $line
fi
- }
+ echo ""
+ done
TMOUT=$DAHDI_DEV_TIMEOUT # max secs to wait