dahdi_span_assignments, dahdi_span_types: Allow conf file to be overridden.

The environment variables that specified the full path the the configuration
files for dahdi_span_types and dahdi_span_assignments was documented, but they
were not actually set from the environment.

Also, the case of the variable was changed to match the one for the directory
where the rest of the config files are located.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
This commit is contained in:
Shaun Ruffell 2013-11-26 12:55:09 -06:00
parent ffced0cad2
commit c0e19d47e8
4 changed files with 11 additions and 11 deletions

View File

@ -54,7 +54,7 @@
devbase='/sys/bus/dahdi_devices/devices' devbase='/sys/bus/dahdi_devices/devices'
DAHDICONFDIR="${DAHDICONFDIR:-/etc/dahdi}" DAHDICONFDIR="${DAHDICONFDIR:-/etc/dahdi}"
assigned_spans_conf="$DAHDICONFDIR/assigned-spans.conf" DAHDISASSIGNEDSPANSCONF="${DAHDIASSIGNEDSPANSCONF:-"${DAHDICONFDIR}/assigned-spans.conf"}"
SPAN_ASSIGNMENTS_KEY=${SPAN_ASSIGNMENTS_KEY:-hwid} SPAN_ASSIGNMENTS_KEY=${SPAN_ASSIGNMENTS_KEY:-hwid}
dry_run= dry_run=
verbose= verbose=
@ -228,7 +228,7 @@ unassign_all_spans() {
# Allow comments and empty lines in config file # Allow comments and empty lines in config file
filter_conf() { filter_conf() {
sed -e 's/#.*//' -e '/^[ \t]*$/d' "$assigned_spans_conf" sed -e 's/#.*//' -e '/^[ \t]*$/d' "$DAHDISASSIGNEDSPANSCONF"
} }
assign_device_spans() { assign_device_spans() {
@ -289,11 +289,11 @@ match_device() {
} }
assign_devices() { assign_devices() {
if [ ! -f "$assigned_spans_conf" ]; then if [ ! -f "$DAHDISASSIGNEDSPANSCONF" ]; then
echo >&2 "$0: Missing '$assigned_spans_conf'" echo >&2 "$0: Missing '$DAHDISASSIGNEDSPANSCONF'"
exit 1 exit 1
fi fi
echo "using '$assigned_spans_conf'" echo "using '$DAHDISASSIGNEDSPANSCONF'"
for device in $DEVICES for device in $DEVICES
do do
match_device "$device" match_device "$device"

View File

@ -47,7 +47,7 @@
devbase='/sys/bus/dahdi_devices/devices' devbase='/sys/bus/dahdi_devices/devices'
DAHDICONFDIR="${DAHDICONFDIR:-/etc/dahdi}" DAHDICONFDIR="${DAHDICONFDIR:-/etc/dahdi}"
spantypes_conf="$DAHDICONFDIR/span-types.conf" DAHDISPANTYPESCONF="${DAHDISPANTYPESCONF:-"${DAHDICONFDIR}/span-types.conf"}"
SPAN_ASSIGNMENTS_KEY=${SPAN_ASSIGNMENTS_KEY:-hwid} SPAN_ASSIGNMENTS_KEY=${SPAN_ASSIGNMENTS_KEY:-hwid}
usage() { usage() {
@ -182,7 +182,7 @@ dump_config() {
# Allow comments and empty lines in config file # Allow comments and empty lines in config file
filter_conf() { filter_conf() {
sed -e 's/#.*//' -e '/^[ \t]*$/d' "$spantypes_conf" sed -e 's/#.*//' -e '/^[ \t]*$/d' "$DAHDISPANTYPESCONF"
} }
conf_spans() { conf_spans() {
@ -242,8 +242,8 @@ device_set_spantype() {
} }
set_spantypes() { set_spantypes() {
if [ ! -f "$spantypes_conf" ]; then if [ ! -f "$DAHDISPANTYPESCONF" ]; then
echo >&2 "$0: Missing configuration '$spantypes_conf'" echo >&2 "$0: Missing configuration '$DAHDISPANTYPESCONF'"
exit 1 exit 1
fi fi
for device in $DEVICES for device in $DEVICES

View File

@ -172,7 +172,7 @@ The directory in which assigned-spans.conf resides. /etc/dahdi if not
overridden from the environment. overridden from the environment.
.RE .RE
.B assigned_spans_conf .B DAHDISASSIGNEDSPANSCONF
.RS .RS
The path to assigned-spans.conf resides. /etc/dahdi/assigned-spans.conf if The path to assigned-spans.conf resides. /etc/dahdi/assigned-spans.conf if
not overridden from the environment. not overridden from the environment.

View File

@ -107,7 +107,7 @@ The directory in which span-types.conf resides. /etc/dahdi if not
overridden from the environment. overridden from the environment.
.RE .RE
.B dahdi_span_types_conf .B DAHDISPANTYPESCONF
.RS .RS
The path to span-types.conf resides. /etc/dahdi/span-types.conf if The path to span-types.conf resides. /etc/dahdi/span-types.conf if
not overridden from the environment. not overridden from the environment.