auto_assign_spans may be true even if not '1'
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>
Thu, 6 Feb 2014 16:46:00 +0000 (18:46 +0200)
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>
Fri, 7 Feb 2014 12:22:49 +0000 (14:22 +0200)
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>

hotplug/dahdi_handle_device
hotplug/dahdi_span_config
xpp/dahdi_registration

index 89e2934..52ce9c2 100755 (executable)
@@ -68,7 +68,7 @@ add)
                echo "Old driver (no auto_assign_spans parameter). Skip $DEVPATH" | $LOGGER
                exit 0
        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
                exit 0
        fi
index 5fce21e..25a10e2 100755 (executable)
@@ -71,7 +71,7 @@ add)
                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"
                exit 0
        fi
index bd6641e..32bd746 100755 (executable)
@@ -35,7 +35,7 @@ my %opts;
 getopts('vRs:', \%opts) || usage;
 
 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 $span_types_config = $ENV{'SPAN_TYPES_CONF_FILE'} || '/etc/dahdi/span-types.conf';
 my $have_assigned_spans_config = -f $assigned_spans_config || 0;