diff options
author | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-08-10 03:33:57 +0000 |
---|---|---|
committer | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-08-10 03:33:57 +0000 |
commit | 6129c183f561d9d82ada2940cf18f4ff3b4b105a (patch) | |
tree | 686a5987efe68c9b8b809230f3d137e385dd5161 /xpp/utils | |
parent | 1d8cd2e98fc16d64845f602824c3aea58a95729d (diff) |
* Added support for readingconfiguration from /etc/sysconfig/zaptel .
* Config file location can be overriden by environment.
* Removed an obsolete function.
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@1290 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'xpp/utils')
-rwxr-xr-x | xpp/utils/genzaptelconf | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/xpp/utils/genzaptelconf b/xpp/utils/genzaptelconf index 1ee0062..ea81ad4 100755 --- a/xpp/utils/genzaptelconf +++ b/xpp/utils/genzaptelconf @@ -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 @@ set_immediate=yes 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 @@ tmp_dir= 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" @@ -160,17 +164,6 @@ update_module_list() { 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() { if [ "$rapid_conf_mode" = 'yes' ] then |