aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2015-05-22 16:22:21 +1200
committerTom Ryder <tom@sanctum.geek.nz>2015-05-22 16:22:21 +1200
commit3929b6d7eefa7a0dcfda72c5797f1a7482287281 (patch)
tree825aa86ce36032f753f0b4e3eba7f3aca6562f81
parentd4b245001a1bc418165d3dfbf08172ea632b3c0e (diff)
downloadnscaw-3929b6d7eefa7a0dcfda72c5797f1a7482287281.tar.gz
Simplify error condition exit
-rwxr-xr-xnscaw13
1 files changed, 4 insertions, 9 deletions
diff --git a/nscaw b/nscaw
index d2ed64d..ca97bac 100755
--- a/nscaw
+++ b/nscaw
@@ -67,18 +67,13 @@ time=${time//$'\t'/ } # Change all tabs to spaces
case $ret in
0)
code=0 # OK
- message=$(printf '%s: `%s` ran with no errors as user %s: %s' \
- "$self" "$*" "$username" "$time")
- ;;
- 127)
- code=3 # UNKNOWN
- message=$(printf '%s: `%s` could not be found as user %s with PATH=%s' \
- "$self" "$1" "$username" "$PATH")
+ message=$(printf '%s: `%s` succeeded: %s' \
+ "$self" "$*" "$time")
;;
*)
code=2 # CRITICAL
- message=$(printf '%s: `%s` ran with errors as user %s: %s' \
- "$self" "$*" "$username" "$time")
+ message=$(printf '%s: `%s` failed (exit %d), USER %s, PATH=%s: %s' \
+ "$self" "$*" "$ret" "$username" "$PATH" "$time")
;;
esac