diff options
author | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2007-06-21 07:41:29 +0000 |
---|---|---|
committer | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2007-06-21 07:41:29 +0000 |
commit | 4fee5e36253f85df9cd9747c53c2af72656d25f4 (patch) | |
tree | 3dd60705478c2128c5c60d6e73d7856415aaa22f /zaptel.init | |
parent | d3ca718aa6d8b72d7308c551b7ee171870482f90 (diff) |
* Remove ztcfg -s from shutdown.
* Someone with a dynamic span, please test the suggested replacement
(remmed-out).
* Reduced nesting in wait_for_xpp .
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@2660 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'zaptel.init')
-rw-r--r-- | zaptel.init | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/zaptel.init b/zaptel.init index f6ae9a4..dd42fa6 100644 --- a/zaptel.init +++ b/zaptel.init @@ -62,12 +62,11 @@ unload_module() { # Wait for Astribank to initialize registers: wait_for_xpp() { - if [ -d /proc/xpp ] - then - # reading from waitfor_xpds only returns when the device - # has finished initilizing its regiters and is available. - cat /proc/xpp/XBUS-*/waitfor_xpds 2>/dev/null >/dev/null || true - fi + if [ ! -d /proc/xpp ]; then return; fi + + # reading from waitfor_xpds only returns when the device + # has finished initilizing its regiters and is available. + cat /proc/xpp/XBUS-*/waitfor_xpds 2>/dev/null >/dev/null || true } # Register to zaptel Astribank spans that were not autoomatically registered @@ -169,6 +168,14 @@ hpec_start() { echo " This can be caused if you had already run zaphpec_enable, or if your HPEC license is no longer valid." fi } + +shutdown_dynamic() { + if ! grep -q ' ZTD/' /proc/* 2>/dev/null; then return; fi + + # we should only get here if we have dynamic spans. Right? + $ZTCFG -s +} + # Check that telephony is up. [ "${TELEPHONY}" = "yes" ] || exit 0 @@ -247,7 +254,7 @@ case "$1" in ;; stop) # Unload drivers - $ZTCFG -s + #shutdown_dynamic # FIXME: needs test from someone with dynamic spans echo -n "Unloading zaptel hardware drivers:" unload_module zaptel RETVAL=$? |