From 17342e0bf5d5cc2fb6425b2affc4ce850657ba1e Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Mon, 25 May 2009 14:30:20 +0000 Subject: Properly fix usage of waitfor_xpds in non-standard settings. From xpp rev. 7137. git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@6655 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- xpp/waitfor_xpds | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/xpp/waitfor_xpds b/xpp/waitfor_xpds index 71c5187..e794593 100755 --- a/xpp/waitfor_xpds +++ b/xpp/waitfor_xpds @@ -25,6 +25,10 @@ set -e +# For lab testing +mydir=`dirname $0` +PATH="${mydir}:${PATH}" + ab_list() { # Only check /sys info (don't use /proc anymore). ab=`find /sys/bus/astribanks/devices/xbus-*/ -name waitfor_xpds 2> /dev/null || :` @@ -32,7 +36,11 @@ ab_list() { } # Any hardware? -if [ "`dahdi_hardware | grep xpp_usb`" = "" ]; then +if ! dahdi_hardware="`which dahdi_hardware 2>/dev/null`"; then + echo >&2 "$0: Missing $dahdi_hardware" + exit 0 +fi +if [ "`$dahdi_hardware | grep xpp_usb`" = "" ]; then exit 0 fi @@ -42,6 +50,7 @@ tries=10 while [ ! -e "/sys/bus/astribanks/devices/xbus-00" ] do if [ "$tries" -le 0 ]; then + echo 1>&2 "TIMEOUT" exit 1 fi echo -n 1>&2 "." -- cgit v1.2.3