xpp_fxloader: handle empty span-type.conf
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>
Tue, 31 Mar 2015 19:37:10 +0000 (22:37 +0300)
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>
Tue, 31 Mar 2015 19:37:10 +0000 (22:37 +0300)
If we have /etc/dahdi/span-types.conf but it doesn't have any
line, we should avoid using the option -S to astribank_hexload.
Fix the test for this.

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

xpp/xpp_fxloader

index ce5133a..5135ebf 100644 (file)
@@ -319,8 +319,9 @@ load_fw_device() {
                                        if [ "$pri_spec_wildcard" != '' ]; then
                                                debug "ECHO($dev_short): Found definitions for wildcard -- $pri_spec_wildcard"
                                        fi
-                                       pri_spec=`echo "$pri_spec_wildcard $pri_spec" | tr -s ' \t\n' ','`
-                                       if [ "$pri_spec" != '' ]; then
+                                       pri_spec_params=""
+                                       if [ "$pri_spec$pri_spec_wildcard" != '' ]; then
+                                               pri_spec=`echo "$pri_spec_wildcard $pri_spec" | tr -s ' \t\n' ','`
                                                pri_spec_params="-S $pri_spec"
                                                debug "ECHO($dev_short): pri_spec_params='$pri_spec_params'"
                                        fi