diff options
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=$? |