[Pkg-voip-commits] [dahdi-tools] 156/285: span_types/assignments: no * in device list

tzafrir at debian.org tzafrir at debian.org
Thu Jul 7 19:18:48 UTC 2016


This is an automated email from the git hooks/post-receive script.

tzafrir pushed a commit to branch master
in repository dahdi-tools.

commit bf960799ea0bda868efbd82641efd9842e1c8499
Author: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
Date:   Thu Jan 2 11:14:38 2014 +0200

    span_types/assignments: no * in device list
    
    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 at xorcom.com>
---
 dahdi_span_assignments | 2 +-
 dahdi_span_types       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dahdi_span_assignments b/dahdi_span_assignments
index 19c70d3..bcafe89 100755
--- a/dahdi_span_assignments
+++ b/dahdi_span_assignments
@@ -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
diff --git a/dahdi_span_types b/dahdi_span_types
index 48a0854..b12fc6f 100755
--- a/dahdi_span_types
+++ b/dahdi_span_types
@@ -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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/dahdi-tools.git



More information about the Pkg-voip-commits mailing list