diff options
author | Shaun Ruffell <sruffell@digium.com> | 2009-06-23 23:45:16 +0000 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2009-06-23 23:45:16 +0000 |
commit | 57e7a7faee371331f1825fe3ced896964b5befb7 (patch) | |
tree | 69256b39490d208472cc25134f05eb709cadf571 /dahdi.init | |
parent | 3c742ca6bb4661d6a2c1c05a3e30cc5107090b95 (diff) |
dahdi.init: Define a default span configuration for digital cards.
If there is a digital card in the system, and there is not a span
configuration line in /etc/dahdi/system.conf, the init script will now create
a temporary default one to use. On some installations, this will allow
asterisk to start before dahdi is fully configured.
This a temporary measure until DAHDI is always able to provide a timing
source.
(related to issue #13205)
git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@6708 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'dahdi.init')
-rwxr-xr-x | dahdi.init | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -200,6 +200,16 @@ case "$1" in modprobe dahdi_dummy 2> /dev/null fi + conf_file=/etc/dahdi/system.conf + temp_conf_file="" + if [ `dahdi_scan | grep "^type=" | sed -n 1p | grep "^type=digital"` ]; then + if [ "`cat $conf_file | grep "^span=1"`" = "" ]; then + temp_conf_file=`mktemp /tmp/tmp.dahdi_system_conf.XXX` + echo "span=1,1,0,esf,b8zs" > $temp_conf_file + DAHDI_CFG_CMD="$DAHDI_CFG -c $temp_conf_file" + fi + fi + if [ $system = debian ]; then echo -n "Running dahdi_cfg: " $DAHDI_CFG_CMD 2> /dev/null && echo -n "done" @@ -209,6 +219,10 @@ case "$1" in fi RETVAL=$? + if [ -f $temp_conf_file ]; then + rm $temp_conf_file; + fi + if [ "$LOCKFILE" != '' ]; then [ $RETVAL -eq 0 ] && touch $LOCKFILE fi |