From c0e19d47e82b6a09b55ba5a33817bd162fe40389 Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Tue, 26 Nov 2013 12:55:09 -0600 Subject: [PATCH] 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 --- dahdi_span_assignments | 10 +++++----- dahdi_span_types | 8 ++++---- doc/dahdi_span_assignments.8 | 2 +- doc/dahdi_span_types.8 | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dahdi_span_assignments b/dahdi_span_assignments index b26a2dc..19c70d3 100755 --- a/dahdi_span_assignments +++ b/dahdi_span_assignments @@ -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" diff --git a/dahdi_span_types b/dahdi_span_types index 293a90c..48a0854 100755 --- a/dahdi_span_types +++ b/dahdi_span_types @@ -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 diff --git a/doc/dahdi_span_assignments.8 b/doc/dahdi_span_assignments.8 index 46083b3..9ba8a49 100644 --- a/doc/dahdi_span_assignments.8 +++ b/doc/dahdi_span_assignments.8 @@ -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. diff --git a/doc/dahdi_span_types.8 b/doc/dahdi_span_types.8 index d28b8e0..c7d221d 100644 --- a/doc/dahdi_span_types.8 +++ b/doc/dahdi_span_types.8 @@ -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.