diff options
Diffstat (limited to 'xpp/waitfor_xpds')
-rwxr-xr-x | xpp/waitfor_xpds | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/xpp/waitfor_xpds b/xpp/waitfor_xpds index 71b7dfc..6bee5f2 100755 --- a/xpp/waitfor_xpds +++ b/xpp/waitfor_xpds @@ -29,6 +29,8 @@ set -e mydir=`dirname $0` PATH="${mydir}:${PATH}" +[ -r /etc/dahdi/init.conf ] && . /etc/dahdi/init.conf + ab_list() { # Only check /sys info (don't use /proc anymore). ab=`find /sys/bus/astribanks/devices/xbus-*/ -name waitfor_xpds 2> /dev/null || :` @@ -40,7 +42,14 @@ 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 +if ! astribank_is_starting="`which astribank_is_starting 2>/dev/null`"; then + echo >&2 "$0: Missing astribank_is_starting" + exit 0 +fi +if [ "`$dahdi_hardware | grep xpp_usb`" != "" ]; then + astribank_is_starting -v -a +fi +if ! astribank_is_starting; then exit 0 fi @@ -60,7 +69,7 @@ done echo "" # Wait for device to stabilize and XPD's to finish initalizations -echo 1>&2 "Astribanks initalization " +echo 1>&2 "Astribanks initializing spans" while if ! ab=`ab_list`; then exit 1 @@ -70,3 +79,14 @@ do oldab="$ab" cat $ab done + +if [ "$XPP_HOTPLUG_DAHDI" = yes ]; then + if [ "$CALLED_FROM_ATRIBANK_HOOK" = '' ]; then + # Now we can wait until the hotplug run would remove the semaphore + echo -n 1>&2 "Other DAHDI initializations... " + astribank_is_starting -v -w 1>&2 + fi +else + # Non-hotplug -- Sequential initialization, remove semaphore + astribank_is_starting -v -r 1>&2 +fi |