[zaptel-commits] russell: branch 1.2 r2342 - /branches/1.2/zaptel.init

zaptel-commits at lists.digium.com zaptel-commits at lists.digium.com
Tue Mar 27 11:48:24 MST 2007


Author: russell
Date: Tue Mar 27 13:48:23 2007
New Revision: 2342

URL: http://svn.digium.com/view/zaptel?view=rev&rev=2342
Log:
When debug is enabled, ensure that "debug=1" gets passed to the zaptel module,
and not just the hardware modules.  Also, run "ztcfg -s" at the beginning of
the "stop" action of the script.
(issue #7409, PCadach and tzafrir)

Modified:
    branches/1.2/zaptel.init

Modified: branches/1.2/zaptel.init
URL: http://svn.digium.com/view/zaptel/branches/1.2/zaptel.init?view=diff&rev=2342&r1=2341&r2=2342
==============================================================================
--- branches/1.2/zaptel.init (original)
+++ branches/1.2/zaptel.init Tue Mar 27 13:48:23 2007
@@ -9,6 +9,8 @@
 # config: /etc/sysconfig/zaptel
 
 initdir=/etc/init.d
+
+ZTCFG=/sbin/ztcfg
 
 #
 # Determine which kind of configuration we're using
@@ -112,7 +114,7 @@
 # Check that telephony is up.
 [ "${TELEPHONY}" = "yes" ] || exit 0
 
-[ -f /sbin/ztcfg ] || exit 0
+[ -f $ZTCFG ] || exit 0
 
 [ -f /etc/zaptel.conf ] || exit 0
 
@@ -131,10 +133,10 @@
 	rmmod audio >& /dev/null
 	if [ $system = debian ]; then
 	    echo -n "Loading zaptel framework: " 
-	    modprobe zaptel >& /dev/null && echo -n "done"
-	    echo "."
-	elif [ $system = redhat ]; then
-	    action "Loading zaptel framework: " modprobe zaptel
+	    modprobe zaptel ${ARGS} >& /dev/null && echo -n "done"
+	    echo "."
+	elif [ $system = redhat ]; then
+	    action "Loading zaptel framework: " modprobe zaptel ${ARGS}
 	fi
 	echo -n "Waiting for zap to come online..."
 	TMOUT=10 # max secs to wait
@@ -165,10 +167,10 @@
 	fi
 	if [ $system = debian ]; then
 	    echo -n "Running ztcfg: " 
-	    /sbin/ztcfg >& /dev/null && echo -n "done"
-	    echo "."
-	elif [ $system = redhat ]; then
-	    action "Running ztcfg: " /sbin/ztcfg
+	    $ZTCFG >& /dev/null && echo -n "done"
+	    echo "."
+	elif [ $system = redhat ]; then
+	    action "Running ztcfg: " $ZTCFG
 	fi
 	RETVAL=$?
 
@@ -176,6 +178,7 @@
 	;;
   stop)
 	# Unload drivers
+	$ZTCFG -s
 	echo -n "Unloading zaptel hardware drivers:"
 	for x in $RMODULES; do 
 		if rmmod ${x} >& /dev/null; then
@@ -202,10 +205,10 @@
   reload)
 	if [ $system = debian ]; then
 	    echo -n "Reloading ztcfg: "
-	    /sbin/ztcfg >& /dev/null && echo -n "done"
-	    echo "."
-	elif [ $system = redhat ]; then
-	    action "Reloading ztcfg: " /sbin/ztcfg
+	    $ZTCFG >& /dev/null && echo -n "done"
+	    echo "."
+	elif [ $system = redhat ]; then
+	    action "Reloading ztcfg: " $ZTCFG
 	fi
 	RETVAL=$?
 	;;



More information about the zaptel-commits mailing list