span_types/assignments: no * in device list
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>
Thu, 2 Jan 2014 09:14:38 +0000 (11:14 +0200)
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>
Mon, 20 Jan 2014 17:22:03 +0000 (19:22 +0200)
If there are no dahdi devices, $devbase/* expans to have a literal '*',
which leads to warnings such as:
/usr/sbin/dahdi_span_types: 1: cd: can't cd to /sys/bus/dahdi_devices/devices/*

Let's just avoid those.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

dahdi_span_assignments
dahdi_span_types

index 19c70d3..bcafe89 100755 (executable)
@@ -141,7 +141,7 @@ fi
 if [ "$#" -gt 0 ]; then
        DEVICES="$@"
 else
-       DEVICES=`echo $devbase/*`
+       DEVICES=`ls -d $devbase/* 2>/dev/null`
 fi
 
 # Beware of special characters in attributes
index 48a0854..b12fc6f 100755 (executable)
@@ -120,7 +120,7 @@ fi
 if [ "$#" -gt 0 ]; then
        DEVICES="$@"
 else
-       DEVICES=`echo $devbase/*`
+       DEVICES=`ls -d $devbase/* 2>/dev/null`
 fi
 
 # Beware of special characters in attributes