summaryrefslogtreecommitdiff
path: root/build_tools
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2009-01-18 15:44:59 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2009-01-18 15:44:59 +0000
commitb500258ec25f9da825fa18f586d262b0ca0f1b12 (patch)
tree800a32601ff4f3d23525776695f8f5ca306daf36 /build_tools
parentf89c302cbde0ea699009df9e5286be5001f16c20 (diff)
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
Diffstat (limited to 'build_tools')
-rwxr-xr-xbuild_tools/live_dahdi8
1 files changed, 5 insertions, 3 deletions
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