From a7a7c76be9f51ab200d70998888d33a82faf4b47 Mon Sep 17 00:00:00 2001 From: tzafrir Date: Tue, 5 Jun 2007 20:35:14 +0000 Subject: * >& does not work with all /bin/sh shells (specifically not /bin/dash , occasionally used as /bin/sh in Debian / Ubuntu). * Removed some unnecessary 2>/dev/null . If ztcfg failed, the user should know, and have the data to fix the problem. * Removing ztcfg -s from the stop target. Who needs it? git-svn-id: http://svn.digium.com/svn/zaptel/trunk@2572 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- zaptel.init | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/zaptel.init b/zaptel.init index 547e816..d7bbdd3 100644 --- a/zaptel.init +++ b/zaptel.init @@ -123,7 +123,7 @@ fix_asterisbank_sync() { # the built-in echo of bash fails to print a proper error on failure if ! /bin/echo "$sync_value" >/proc/xpp/sync then - echo >&2 "Updating XPP sync source failed (tried \"$sync_value\", XPP_SYNC='$XPP_SYNC')" + echo >2 "Updating XPP sync source failed (tried \"$sync_value\", XPP_SYNC='$XPP_SYNC')" fi } @@ -141,7 +141,7 @@ fi run_ztcfg() { if [ $system = debian ]; then echo -n "Running ztcfg: " - $ZTCFG_CMD >/dev/null 2>&1 && echo -n "done" + $ZTCFG_CMD && echo -n "done" RETVAL=$? echo "." elif [ $system = redhat ]; then @@ -156,12 +156,12 @@ RETVAL=0 case "$1" in start) # Load drivers - rmmod wcusb >& /dev/null - rmmod wcfxsusb >& /dev/null - rmmod audio >& /dev/null + rmmod wcusb 2> /dev/null + rmmod wcfxsusb 2> /dev/null + rmmod audio 2> /dev/null if [ $system = debian ]; then echo -n "Loading zaptel framework: " - modprobe zaptel ${ARGS} >& /dev/null && echo -n "done" + modprobe zaptel ${ARGS} 2> /dev/null && echo -n "done" echo "." elif [ $system = redhat ]; then action "Loading zaptel framework: " modprobe zaptel ${ARGS} @@ -180,7 +180,7 @@ case "$1" in echo -n "Loading zaptel hardware modules:" for x in $MODULES; do eval localARGS="\$${x}_ARGS" - if modprobe ${x} ${ARGS} ${localARGS} >& /dev/null; then + if modprobe ${x} ${ARGS} ${localARGS} 2> /dev/null; then echo -n " $x" fi done @@ -190,9 +190,9 @@ case "$1" in zap_reg_xpp fix_asterisbank_sync # can actually be run after ztcfg - if [ ! -e /proc/zaptel/1 ]; then - echo "No functioning zap hardware found in /proc/zaptel, loading ztdummy" - modprobe ztdummy >& /dev/null + if head -c 0 /dev/zap/pseudo; then + echo "No Zaptel timing source sound. loading ztdummy" + modprobe ztdummy fi run_ztcfg @@ -225,7 +225,7 @@ case "$1" in # zaphpec_enable properly installed if [ $system = debian ]; then echo -n "Running zaphpec_enable: " - /usr/sbin/zaphpec_enable >& /dev/null + /usr/sbin/zaphpec_enable 2> /dev/null elif [ $system = redhat ]; then action "Running zaphpec_enable: " /usr/sbin/zaphpec_enable fi @@ -243,7 +243,6 @@ case "$1" in ;; stop) # Unload drivers - $ZTCFG -s echo -n "Unloading zaptel hardware drivers:" unload_module zaptel RETVAL=$? -- cgit v1.2.3