FIXED: "alarm-notify.sh test" produces error exit code on success
- Changed to produce "0" exit code on success - Exit code "1" is produced only if there is any error spotted
Andrey Galkin committed
Apr 29, 2018 at 17:39 UTC
a457ae7133ab3d20158729b8c676c4e2d18287d7
1 file changed
+3
-1
plugins.d/alarm-notify.sh
+3
-1
@@ -44,6 +44,7 @@ then
44
45
id=1
46
last="CLEAR"
47
+ test_res=0
48
for x in "WARNING" "CRITICAL" "CLEAR"
49
do
50
echo >&2
@@ -53,6 +54,7 @@ then
54
if [ $? -ne 0 ]
55
then
56
echo >&2 "# FAILED"
57
+ test_res=1
58
else
59
echo >&2 "# OK"
60
fi
@@ -61,7 +63,7 @@ then
63
id=$((id + 1))
64
done
65
64
- exit 1
66
+ exit $test_res
67
fi
68
69
export PATH="${PATH}:/sbin:/usr/sbin:/usr/local/sbin"