handle_device: don't fail if no config files
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>
Mon, 23 Sep 2013 17:43:25 +0000 (20:43 +0300)
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>
Tue, 1 Oct 2013 18:56:47 +0000 (21:56 +0300)
Allow the udev rule to work well even if there's no span-types.conf

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

handle_device

index 498ebf0..a25c921 100755 (executable)
@@ -49,8 +49,12 @@ add)
 
        # Don't block udev for too long
        (
-               span_types set "/sys$DEVPATH"
-               span_assignments add "/sys$DEVPATH"
+               if [ -r "$DAHDICONFDIR/span-types.conf" ]; then
+                       span_types set "/sys$DEVPATH"
+               fi
+               if [ -r "$DAHDICONFDIR/pinned-spans.conf" ]; then
+                       span_assignments add "/sys$DEVPATH"
+               fi
        ) 2>&1 < /dev/null | $LOGGER &
        ;;
 remove)