diff options
author | Dave Reisner <dreisner@archlinux.org> | 2012-01-16 11:23:42 -0500 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2012-01-22 20:33:22 -0500 |
commit | 89e3f31a64a354b850e6297c67c625f7dd6872b4 (patch) | |
tree | 2c38ff94dfbf8b6ad406a549d2abbb6d2369e048 | |
parent | d1ff60b00ee46b16ba8fd0f51b268b438686c557 (diff) |
functions: allow verbose output from status()
Detect -v as a parameter to status and avoid dumping everything to
/dev/null. Use this to restore error output to modprobe on loading
user-specified modules.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rw-r--r-- | functions | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -171,9 +171,14 @@ stat_die() { } status() { + [[ $1 = '-v' ]] && { local v=1; shift; } stat_busy "$1" shift - "$@" &>/dev/null + if (( v )); then + "$@" + else + "$@" &>/dev/null + fi local ret=$? (( ret == 0 )) && stat_done || stat_fail return $ret @@ -354,7 +359,7 @@ udevd_modprobe() { # Load modules from the MODULES array defined in rc.conf [[ -f /proc/modules ]] && (( ${#MODULES[*]} )) && - status "Loading User-specified Modules" modprobe -ab "${MODULES[@]}" + status -v "Loading User-specified Modules" modprobe -ab "${MODULES[@]}" status "Waiting for UDev uevents to be processed" \ udevadm settle |