[zaptel-commits] tzafrir: branch tzafrir/zaphelper r1635 -
/team/tzafrir/zaphelper/examples/
zaptel-commits at lists.digium.com
zaptel-commits at lists.digium.com
Wed Nov 22 16:19:54 MST 2006
Author: tzafrir
Date: Wed Nov 22 17:19:54 2006
New Revision: 1635
URL: http://svn.digium.com/view/zaptel?view=rev&rev=1635
Log:
Simplify the red-hat version of the init.d script.
Modified:
team/tzafrir/zaphelper/examples/zaptel.rh.init
Modified: team/tzafrir/zaphelper/examples/zaptel.rh.init
URL: http://svn.digium.com/view/zaptel/team/tzafrir/zaphelper/examples/zaptel.rh.init?view=diff&rev=1635&r1=1634&r2=1635
==============================================================================
--- team/tzafrir/zaphelper/examples/zaptel.rh.init (original)
+++ team/tzafrir/zaphelper/examples/zaptel.rh.init Wed Nov 22 17:19:54 2006
@@ -17,43 +17,23 @@
ZAPHELPER_PATH=/sbin/zaptel-helper
ZTCFG=/sbin/ztcfg
+ZAPCONF_FILE=/etc/zaptel.conf
-#
-# Determine which kind of configuration we're using
-#
-system=redhat # assume redhat
-if [ -f /etc/debian_version ]; then
- system=debian
-fi
+MODULES="${MODULES:-tor2 wct4xxp wct1xxp wcte11xp wcfxo wctdm wctdm24xxp}"
-# Source function library.
-if [ $system = redhat ]; then
- . $initdir/functions || exit 0
-fi
+. $initdir/functions || exit 0
-# Source zaptel configuration.
-if [ $system = debian ]; then
- set -e
- if [ -r /etc/default/zaptel ]; then . /etc/default/zaptel; fi
- LOCKFILE=/var/lock/zaptel # FIXME: not used with Debian.
-elif [ $system = redhat ]; then
- [ -r /etc/sysconfig/zaptel ] && . /etc/sysconfig/zaptel
- LOCKFILE=/var/lock/subsys/zaptel
-fi
+if [ -r /etc/sysconfig/zaptel ]; then . /etc/sysconfig/zaptel; fi
+LOCKFILE=/var/lock/subsys/zaptel
if [ -r "$ZAPHELPER_PATH" ]; then . $ZAPHELPER_PATH; fi
-
-if [ -z "${MODULES}" ]; then
- # Populate defaults if not present
- MODULES="tor2 wct4xxp wct1xxp wcte11xp wcfxo wctdm wctdm24xxp"
-fi
# Check that telephony is up.
[ "${TELEPHONY}" = "yes" ] || exit 0
-[ -f /sbin/ztcfg ] || exit 0
+if [ ! -x $ZTCFG ]; then exit 0; fi
-[ -f /etc/zaptel.conf ] || exit 0
+if [ ! -r $ZAPCONF_FILE ]; then exit 0; fi
RETVAL=0
@@ -68,9 +48,7 @@
fi
# Get the Astribank module loaded properly:
- wait_for_xpp
- zap_reg_xpp
- fix_asterisbank_sync
+ init_astribank
# wait for udev to generate /dev/zap/ctl before running ztcfg
wait_for_zapctl
@@ -79,6 +57,8 @@
# FIXME: we check that /dev/zap/ctl was generated, not that
# /dev/zap/pseudo was generated.
guarantee_timing_source
+
+ fxotune_load
$ZTCFG
@@ -102,13 +82,7 @@
$0 start
;;
reload)
- if [ $system = debian ]; then
- echo -n "Reloading ztcfg: "
- $ZTCFG && echo -n "done"
- echo "."
- elif [ $system = redhat ]; then
- action "Reloading ztcfg: " $ZTCFG
- fi
+ action "Reloading ztcfg: " $ZTCFG
RETVAL=$?
;;
*)
More information about the zaptel-commits
mailing list