]> err.no Git - systemd/commitdiff
firmware: do not print error if logger is missing
authorKay Sievers <kay.sievers@vrfy.org>
Mon, 15 Oct 2007 22:54:14 +0000 (00:54 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Mon, 15 Oct 2007 22:54:14 +0000 (00:54 +0200)
extras/firmware/firmware.sh

index 49845bad0f13e1766cb3b69589ef2c911721568a..b89b4282c78425e907152ce6d32c2995b3b92022 100755 (executable)
@@ -3,23 +3,21 @@
 FIRMWARE_DIRS="/lib/firmware /usr/local/lib/firmware"
 
 err() {
-    echo "$@" >&2
-    if type logger >/dev/null; then
-       logger -t "${0##*/}[$$]" "$@"
-    fi
+       echo "$@" >&2
+       logger -t "${0##*/}[$$]" "$@" 2>/dev/null || true
 }
 
 if [ ! -e /sys$DEVPATH/loading ]; then
-    err "udev firmware loader misses sysfs directory"
-    exit 1
+       err "udev firmware loader misses sysfs directory"
+       exit 1
 fi
 
 for DIR in $FIRMWARE_DIRS; do
-    [ -e "$DIR/$FIRMWARE" ] || continue
-    echo 1 > /sys$DEVPATH/loading
-    cat "$DIR/$FIRMWARE" > /sys$DEVPATH/data
-    echo 0 > /sys$DEVPATH/loading
-    exit 0
+       [ -e "$DIR/$FIRMWARE" ] || continue
+       echo 1 > /sys$DEVPATH/loading
+       cat "$DIR/$FIRMWARE" > /sys$DEVPATH/data
+       echo 0 > /sys$DEVPATH/loading
+       exit 0
 done
 
 echo -1 > /sys$DEVPATH/loading