[dahdi-commits] tzafrir: linux/trunk r5672 - /linux/trunk/build_tools/live_dahdi

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Sun Jan 18 09:44:59 CST 2009


Author: tzafrir
Date: Sun Jan 18 09:44:59 2009
New Revision: 5672

URL: http://svn.digium.com/svn-view/dahdi?view=rev&rev=5672
Log:
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.

Modified:
    linux/trunk/build_tools/live_dahdi

Modified: linux/trunk/build_tools/live_dahdi
URL: http://svn.digium.com/svn-view/dahdi/linux/trunk/build_tools/live_dahdi?view=diff&rev=5672&r1=5671&r2=5672
==============================================================================
--- linux/trunk/build_tools/live_dahdi (original)
+++ linux/trunk/build_tools/live_dahdi Sun Jan 18 09:44:59 2009
@@ -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 @@
 # 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 @@
 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 -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




More information about the dahdi-commits mailing list