summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorAlexander Hall <halex@cvs.openbsd.org>2013-10-18 23:25:03 +0000
committerAlexander Hall <halex@cvs.openbsd.org>2013-10-18 23:25:03 +0000
commit8743475110e7e91b408e60454f101f39f79cf583 (patch)
tree4d2fc8a452c47b306f5461c4500a08aeae31a4f5 /usr.sbin
parentda16c4a585db0f4d4c68c63f8e1ec68bad619792 (diff)
don't silence stderr from pkg_add when running in verbose mode
suggested by Alexander Holupirek ok rpe@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/fw_update/fw_update.sh14
1 files changed, 11 insertions, 3 deletions
diff --git a/usr.sbin/fw_update/fw_update.sh b/usr.sbin/fw_update/fw_update.sh
index 696b7328bb0..727ae17c30f 100644
--- a/usr.sbin/fw_update/fw_update.sh
+++ b/usr.sbin/fw_update/fw_update.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-# $OpenBSD: fw_update.sh,v 1.16 2013/08/20 22:42:08 halex Exp $
+# $OpenBSD: fw_update.sh,v 1.17 2013/10/18 23:25:02 halex Exp $
# Copyright (c) 2011 Alexander Hall <alexander@beard.se>
#
# Permission to use, copy, modify, and distribute this software for any
@@ -40,6 +40,14 @@ setpath() {
export PKG_PATH=http://firmware.openbsd.org/firmware/$version/
}
+perform() {
+ if [ "$verbose" ]; then
+ "$@"
+ else
+ "$@" 2>/dev/null
+ fi
+}
+
all=false
verbose=
nop=
@@ -100,11 +108,11 @@ fi
# Install missing firmware
if [ "$install" ]; then
verbose "Installing firmware files:$install."
- $PKG_ADD $nop $verbose $install 2>/dev/null
+ perform $PKG_ADD $nop $verbose $install
fi
# Update installed firmware
if [ "$update" ]; then
verbose "Updating firmware files:$update."
- $PKG_ADD $extra $nop $verbose -u $update 2>/dev/null
+ perform $PKG_ADD $extra $nop $verbose -u $update
fi