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

View File

@ -47,7 +47,7 @@
devbase='/sys/bus/dahdi_devices/devices'
DAHDICONFDIR="${DAHDICONFDIR:-/etc/dahdi}"
spantypes_conf="$DAHDICONFDIR/span-types.conf"
DAHDISPANTYPESCONF="${DAHDISPANTYPESCONF:-"${DAHDICONFDIR}/span-types.conf"}"
SPAN_ASSIGNMENTS_KEY=${SPAN_ASSIGNMENTS_KEY:-hwid}
usage() {
@ -182,7 +182,7 @@ dump_config() {
# Allow comments and empty lines in config file
filter_conf() {
sed -e 's/#.*//' -e '/^[ \t]*$/d' "$spantypes_conf"
sed -e 's/#.*//' -e '/^[ \t]*$/d' "$DAHDISPANTYPESCONF"
}
conf_spans() {
@ -242,8 +242,8 @@ device_set_spantype() {
}
set_spantypes() {
if [ ! -f "$spantypes_conf" ]; then
echo >&2 "$0: Missing configuration '$spantypes_conf'"
if [ ! -f "$DAHDISPANTYPESCONF" ]; then
echo >&2 "$0: Missing configuration '$DAHDISPANTYPESCONF'"
exit 1
fi
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.
.RE
.B assigned_spans_conf
.B DAHDISASSIGNEDSPANSCONF
.RS
The path to assigned-spans.conf resides. /etc/dahdi/assigned-spans.conf if
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.
.RE
.B dahdi_span_types_conf
.B DAHDISPANTYPESCONF
.RS
The path to span-types.conf resides. /etc/dahdi/span-types.conf if
not overridden from the environment.