From 7816a006d20ec8e5d14dd54176651b9190047e25 Mon Sep 17 00:00:00 2001 From: Alex Povel Date: Mon, 29 Mar 2021 16:58:19 +0200 Subject: [PATCH] Add success-based exit code --- tinystatus | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tinystatus b/tinystatus index 838370b..2a9fa28 100755 --- a/tinystatus +++ b/tinystatus @@ -86,8 +86,10 @@ EOF outagenb=$(find ${tmp}/ko -mindepth 1 | grep -c 'status$') if [ ${outagenb} -ne 0 ]; then echo "" + exitcode=1 else echo "" + exitcode=0 fi cat << EOF

Services

@@ -122,3 +124,5 @@ cat </dev/null +# Allow the script execution itself to signal success, e.g. for use in healthchecks +exit ${exitcode}