[zaptel-commits] tzafrir: trunk r1290 - /trunk/xpp/utils/genzaptelconf

zaptel-commits at lists.digium.com zaptel-commits at lists.digium.com
Wed Aug 9 20:33:58 MST 2006


Author: tzafrir
Date: Wed Aug  9 22:33:57 2006
New Revision: 1290

URL: http://svn.digium.com/view/zaptel?rev=1290&view=rev
Log:
* Added support for readingconfiguration from /etc/sysconfig/zaptel .
* Config file location can be overriden by environment.
* Removed an obsolete function.

Modified:
    trunk/xpp/utils/genzaptelconf

Modified: trunk/xpp/utils/genzaptelconf
URL: http://svn.digium.com/view/zaptel/trunk/xpp/utils/genzaptelconf?rev=1290&r1=1289&r2=1290&view=diff
==============================================================================
--- trunk/xpp/utils/genzaptelconf (original)
+++ trunk/xpp/utils/genzaptelconf Wed Aug  9 22:33:57 2006
@@ -29,7 +29,9 @@
 
 # The script uses a number of bash-specific features
 # TODO: either ditch them or convert to perl
-# Don't override variables here. Override them in /etc/default/zaptel
+# Don't override variables here. 
+# Override them in /etc/default/zaptel o
+# 
 #
 # 0.5.4:
 # * fixed a typo: it's waitfor_xpds and not wait_for_xpds
@@ -86,7 +88,8 @@
 
 ZAPCONF_FILE=/etc/zaptel.conf
 ZAPATA_FILE=/etc/asterisk/zapata-channels.conf
-ZAPTEL_BOOT=/etc/default/zaptel
+ZAPTEL_BOOT_DEBIAN=${ZAPTEL_BOOT_DEBIAN:-/etc/default/zaptel}
+ZAPTEL_BOOT_FEDORA=${ZAPTEL_BOOT_FEDORA:-/etc/sysconfig/zaptel}
 MODLIST_FILE=/etc/modules
 exten_base_dir=/etc/asterisk/extensions-phones.d
 exten_defs_file=/etc/asterisk/extensions-defs.conf
@@ -102,7 +105,8 @@
 ALL_MODULES="zaphfc qozap ztgsm wctdm wctdm24xxp wcfxo wcfxs pciradio tor2 torisa wct1xxp wct4xxp wcte11xp wanpipe wcusb xpp_usb"
 
 # read default configuration from /etc/default/zaptel
-if [ -r $ZAPTEL_BOOT ]; then . $ZAPTEL_BOOT; fi
+if [ -r $ZAPTEL_BOOT_DEBIAN ]; then . $ZAPTEL_BOOT_DEBIAN; fi
+if [ -r $ZAPTEL_BOOT_FEDORA ]; then . $ZAPTEL_BOOT_FEDORA; fi
 
 # it is safe to use -c twice: the last one will be used.
 ztcfg_cmd="$ZTCFG -c $ZAPCONF_FILE"
@@ -158,17 +162,6 @@
 	do
 		echo "$i"
 	done >> "$MODLIST_FILE"
-}
-
-do_update() {
-	if [ ! -d `dirname ${ZAPTEL_BOOT}` ]
-	then
-		return
-	fi
-	sed -i.bak "s/^$1=.*\$/$1=\"$2\"/" ${ZAPTEL_BOOT}
-	if ! grep -q "^$1=" ${ZAPTEL_BOOT}; then
-		echo "$1=\"$2\"" >> ${ZAPTEL_BOOT}
-	fi
 }
 
 update_extensions_defs() {



More information about the zaptel-commits mailing list