dahdi_span_assignments, dahdi_span_types: Allow conf file to be overridden.
authorShaun Ruffell <sruffell@digium.com>
Tue, 26 Nov 2013 18:55:09 +0000 (12:55 -0600)
committerShaun Ruffell <sruffell@digium.com>
Tue, 26 Nov 2013 19:50:02 +0000 (13:50 -0600)
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>

dahdi_span_assignments
dahdi_span_types
doc/dahdi_span_assignments.8
doc/dahdi_span_types.8

index b26a2dc..19c70d3 100755 (executable)
@@ -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"
index 293a90c..48a0854 100755 (executable)
@@ -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
index 46083b3..9ba8a49 100644 (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.
index d28b8e0..c7d221d 100644 (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.