summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2007-10-16 00:54:14 +0200
committerKay Sievers <kay.sievers@vrfy.org>2007-10-16 00:54:14 +0200
commit6e9edde6c962ab183e8d86086bddda7aa6e3cb9b (patch)
treeab197aad4d1e54051dd24f3ca0ebba707e3e342b
parentdab3fe36cfad807bb9cb8389b1c95825a4b04e6b (diff)
firmware: do not print error if logger is missing
-rwxr-xr-xextras/firmware/firmware.sh20
1 files changed, 9 insertions, 11 deletions
diff --git a/extras/firmware/firmware.sh b/extras/firmware/firmware.sh
index 49845bad0f..b89b4282c7 100755
--- a/extras/firmware/firmware.sh
+++ b/extras/firmware/firmware.sh
@@ -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