auto_assign_spans may be true even if not '1'

auto_assign_spans is an int and may have legal values other than 1. It
is legal (though pointless) to use: modprobe dahdi auto_assign_spans=3.
Any value != 0 is true.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>
This commit is contained in:
Tzafrir Cohen 2014-02-06 18:46:00 +02:00
parent 27d07446ef
commit dd752529f0
3 changed files with 3 additions and 3 deletions

View File

@ -68,7 +68,7 @@ add)
echo "Old driver (no auto_assign_spans parameter). Skip $DEVPATH" | $LOGGER echo "Old driver (no auto_assign_spans parameter). Skip $DEVPATH" | $LOGGER
exit 0 exit 0
fi fi
if [ `cat /sys/module/dahdi/parameters/auto_assign_spans` -eq 1 ]; then if [ `cat /sys/module/dahdi/parameters/auto_assign_spans` -ne 0 ]; then
echo "auto_assign_spans=1. Skip $DEVPATH" | $LOGGER echo "auto_assign_spans=1. Skip $DEVPATH" | $LOGGER
exit 0 exit 0
fi fi

View File

@ -71,7 +71,7 @@ add)
fi fi
fi fi
if [ $(cat /sys/module/dahdi/parameters/auto_assign_spans) -eq 1 ]; then if [ $(cat /sys/module/dahdi/parameters/auto_assign_spans) -ne 0 ]; then
$LOGGER "auto_assign_spans=1. Skip $DEVPATH" $LOGGER "auto_assign_spans=1. Skip $DEVPATH"
exit 0 exit 0
fi fi

View File

@ -35,7 +35,7 @@ my %opts;
getopts('vRs:', \%opts) || usage; getopts('vRs:', \%opts) || usage;
my $dahdi_autoreg = check_param('/sys/module/xpp/parameters/dahdi_autoreg') eq 'Y'; my $dahdi_autoreg = check_param('/sys/module/xpp/parameters/dahdi_autoreg') eq 'Y';
my $auto_assign_spans = check_param('/sys/module/dahdi/parameters/auto_assign_spans') eq '1'; my $auto_assign_spans = check_param('/sys/module/dahdi/parameters/auto_assign_spans') ne '0';
my $assigned_spans_config = $ENV{'ASSIGNED_SPANS_CONF_FILE'} || '/etc/dahdi/assigned-spans.conf'; my $assigned_spans_config = $ENV{'ASSIGNED_SPANS_CONF_FILE'} || '/etc/dahdi/assigned-spans.conf';
my $span_types_config = $ENV{'SPAN_TYPES_CONF_FILE'} || '/etc/dahdi/span-types.conf'; my $span_types_config = $ENV{'SPAN_TYPES_CONF_FILE'} || '/etc/dahdi/span-types.conf';
my $have_assigned_spans_config = -f $assigned_spans_config || 0; my $have_assigned_spans_config = -f $assigned_spans_config || 0;