From 610e410b984a3dc9dbc5ab43bed16f5461f03130 Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Fri, 6 Nov 2009 18:32:20 +0000 Subject: slightly simplify the new dahdi.init git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@7497 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- dahdi.init | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/dahdi.init b/dahdi.init index 7fb16cc..cbc9dc7 100755 --- a/dahdi.init +++ b/dahdi.init @@ -78,16 +78,17 @@ unload_module() { # xpp_usb keeps the xpds below busy if an xpp hardware is # connected. Hence must be removed before them: case "$module" in xpd_*) mods="xpp_usb $mods";; esac + for mod in $mods; do - (echo $mod | grep dahdi_echocan) > /dev/null 2>&1 - if [ $? != 0 ]; then + case "$mod" in + dahdi_echocan_*) + ec_modules="$mod $ec_modules" + ;; + *) # run in a subshell, so it won't step over our vars: (unload_module $mod) - else - ec_modules="$mod $ec_modules" - fi - # TODO: the following is probably the error handling we want: - # if [ $? != 0 ]; then return 1; fi + ;; + esac done # Now that all the other dependencies are unloaded, we can unload the # dahdi_echocan modules. The drivers that register spans may keep -- cgit v1.2.3