From 3585925a435bd74f07c64b12b898d09f6d1e7e9b Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Sun, 18 Jan 2009 15:44:59 +0000 Subject: live_dahdi: reload on unloaded system, path to dahdi-linux * Script runs with -e. But we should not fail if either: - Asterisk was not running - The module dahdi was not loaded. * The configure script of dahdi-tools should get absolute path to dahdi-linux. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5672 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- build_tools/live_dahdi | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'build_tools') diff --git a/build_tools/live_dahdi b/build_tools/live_dahdi index 3b2da7c..1ebed97 100755 --- a/build_tools/live_dahdi +++ b/build_tools/live_dahdi @@ -3,6 +3,7 @@ set -e LINUX_DIR=${LINUX_DIR:=.} +LINUX_DIR_FULL=`(cd $LINUX_DIR; pwd)` TOOLS_DIR=${TOOLS_DIR:=`(cd ../dahdi-tools; pwd)`} DESTDIR=$PWD/live KVERS=${KVERS:-`uname -r`} @@ -98,7 +99,7 @@ xpp_startup() { # returns: the result from unload_module() { module="$1" - line=`lsmod 2>/dev/null | grep "^$1 "` + line=`lsmod 2>/dev/null | grep "^$1 " || :` if [ "$line" = '' ]; then return; fi # module was not loaded set -- $line @@ -139,7 +140,7 @@ usage() { case "$1" in configure) shift - cd "$TOOLS_DIR"; ./configure --with-dahdi="$LINUX_DIR" "$@" + cd "$TOOLS_DIR"; ./configure --with-dahdi="$LINUX_DIR_FULL" "$@" ;; install) shift @@ -161,7 +162,8 @@ rsync) rsync -ai "$0" $DESTDIR "$2:/tmp/" ;; unload) - $AST_SCRIPT stop + # OK for Asterisk not to be running. TODO: a better test? + $AST_SCRIPT stop || : for mod in $REMOVE_MODULES; do unload_module $mod done -- cgit v1.2.3