From 89e3f31a64a354b850e6297c67c625f7dd6872b4 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Mon, 16 Jan 2012 11:23:42 -0500 Subject: 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 --- functions | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'functions') diff --git a/functions b/functions index aad741a..98a3283 100644 --- a/functions +++ b/functions @@ -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 -- cgit v1.2.3