Add success-based exit code
parent
01893d422a
commit
7816a006d2
|
@ -86,8 +86,10 @@ EOF
|
||||||
outagenb=$(find ${tmp}/ko -mindepth 1 | grep -c 'status$')
|
outagenb=$(find ${tmp}/ko -mindepth 1 | grep -c 'status$')
|
||||||
if [ ${outagenb} -ne 0 ]; then
|
if [ ${outagenb} -ne 0 ]; then
|
||||||
echo "<ul><li class='panel failed-bg'>${outagenb} Outage(s)</li></ul>"
|
echo "<ul><li class='panel failed-bg'>${outagenb} Outage(s)</li></ul>"
|
||||||
|
exitcode=1
|
||||||
else
|
else
|
||||||
echo "<ul><li class='panel success-bg'>All Systems Operational</li></ul>"
|
echo "<ul><li class='panel success-bg'>All Systems Operational</li></ul>"
|
||||||
|
exitcode=0
|
||||||
fi
|
fi
|
||||||
cat << EOF
|
cat << EOF
|
||||||
<h1>Services</h1>
|
<h1>Services</h1>
|
||||||
|
@ -122,3 +124,5 @@ cat <<EOF
|
||||||
EOF
|
EOF
|
||||||
rm -r "${tmp}" 2>/dev/null
|
rm -r "${tmp}" 2>/dev/null
|
||||||
|
|
||||||
|
# Allow the script execution itself to signal success, e.g. for use in healthchecks
|
||||||
|
exit ${exitcode}
|
||||||
|
|
Loading…
Reference in New Issue