diff options
author | Shaun Ruffell <sruffell@digium.com> | 2008-07-08 21:27:10 +0000 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2008-07-08 21:27:10 +0000 |
commit | 0a0e54e558f099c49208e5d2e474808891ad843d (patch) | |
tree | cf46b597dfdf0f2002c669646e065913b560d078 /dahdi.init | |
parent | e88502949fd8cbe7edf37dd76c2b2c2286a88ff8 (diff) |
Use system default method to show when modules are loaded.
Still needs refactoring to have one function that works on different
platforms.
git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@4579 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'dahdi.init')
-rwxr-xr-x | dahdi.init | 28 |
1 files changed, 19 insertions, 9 deletions
@@ -154,11 +154,15 @@ case "$1" in 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" + 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 fi done echo -ne $"\n" @@ -210,10 +214,16 @@ case "$1" in stop) # Unload drivers #shutdown_dynamic # FIXME: needs test from someone with dynamic spans - echo -ne $"Unloading DAHDI hardware drivers:" - unload_module dahdi - RETVAL=$? - echo -ne $" DONE\n" + if [ $system = debian ]; then + echo -ne $"Unloading DAHDI hardware modules: " + if unload_module dahdi; then + echo -n "done" + else + echo -n "error" + fi + elif [ $system = redhat ]; then + action "Unloading DAHDI hardware modules: " unload_module dahdi + fi if [ "$LOCKFILE" != '' ]; then [ $RETVAL -eq 0 ] && rm -f $LOCKFILE fi |