[zaptel-commits] tzafrir: branch 1.4 r2954 - /branches/1.4/zaptel.init

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Sat Aug 25 18:04:58 CDT 2007


Author: tzafrir
Date: Sat Aug 25 18:04:57 2007
New Revision: 2954

URL: http://svn.digium.com/view/zaptel?view=rev&rev=2954
Log:
zaptel.init: Allow passing extra arguments (e.g.: -c conffig) to ztcfg.

Modified:
    branches/1.4/zaptel.init

Modified: branches/1.4/zaptel.init
URL: http://svn.digium.com/view/zaptel/branches/1.4/zaptel.init?view=diff&rev=2954&r1=2953&r2=2954
==============================================================================
--- branches/1.4/zaptel.init (original)
+++ branches/1.4/zaptel.init Sat Aug 25 18:04:57 2007
@@ -14,6 +14,8 @@
 # /etc/defualt/zaptel (depending on your system) instead.
 
 ZTCFG=/sbin/ztcfg
+ZTCFG_CMD="$ZTCFG" # e.g: for a custom zaptel.conf location
+
 # The default syncer Astribank. Usually set automatically to a sane
 # value by xpp_sync(1) if you have an Astribank. You can set this to an
 # explicit Astribank (e.g: 01).
@@ -137,13 +139,13 @@
 	if ! grep -q ' ZTD/' /proc/* 2>/dev/null; then return; fi
 
 	# we should only get here if we have dynamic spans. Right?
-	$ZTCFG -s
+	$ZTCFG_CMD -s
 }
 
 # Check that telephony is up.
 [ "${TELEPHONY}" = "yes" ] || exit 0
 
-[ -f $ZTCFG ] || exit 0
+[ -x "$ZTCFG" ] || exit 0
 
 [ -f /etc/zaptel.conf ] || exit 0
 
@@ -197,10 +199,10 @@
 	fi
 	if [ $system = debian ]; then
 	    echo -n "Running ztcfg: " 
-	    $ZTCFG 2> /dev/null && echo -n "done"
+	    $ZTCFG_CMD 2> /dev/null && echo -n "done"
 	    echo "."
 	elif [ $system = redhat ]; then
-	    action "Running ztcfg: " $ZTCFG
+	    action "Running ztcfg: " $ZTCFG_CMD
 	fi
 	RETVAL=$?
 
@@ -230,10 +232,10 @@
   reload)
 	if [ $system = debian ]; then
 	    echo -n "Reloading ztcfg: "
-	    $ZTCFG 2> /dev/null && echo -n "done"
+	    $ZTCFG_CMD 2> /dev/null && echo -n "done"
 	    echo "."
 	elif [ $system = redhat ]; then
-	    action "Reloading ztcfg: " $ZTCFG
+	    action "Reloading ztcfg: " $ZTCFG_CMD
 	fi
 	RETVAL=$?
 	;;




More information about the zaptel-commits mailing list