aboutsummaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorKurt J. Bosch <kjb-temp-2009@alpenjodel.de>2011-07-03 19:36:29 +0200
committerKurt J. Bosch <kjb-temp-2009@alpenjodel.de>2011-07-10 18:22:37 +0200
commit834d47fedd68a5adbd6152649363d99b6ad642b4 (patch)
treecd7b52193984f92dd0781c81bca7b9f29ae91d19 /functions
parented0a943cc9762a1ccaf38bd3c36c31bf56f60fd9 (diff)
downloadinitscripts-834d47fedd68a5adbd6152649363d99b6ad642b4.tar.xz
functions: Make status() return the actual exit code
The exit code returned by the given command might be useful/expected, so don't discard but return it.
Diffstat (limited to 'functions')
-rw-r--r--functions10
1 files changed, 4 insertions, 6 deletions
diff --git a/functions b/functions
index 202db30..6efcd52 100644
--- a/functions
+++ b/functions
@@ -156,12 +156,10 @@ stat_die() {
status() {
stat_busy "$1"
shift
- if "$@" &>/dev/null; then
- stat_done
- return 0
- fi
- stat_fail
- return 1
+ "$@" &>/dev/null
+ local ret=$?
+ (( $ret == 0 )) && stat_done || stat_fail
+ return $ret
}
# usage : in_array( $needle, $haystack )