From 491fdce44f3ec8a12c2cae25666f5ef5d85e2654 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 df047f4..eed6c50 100755 --- a/tinystatus +++ b/tinystatus @@ -84,8 +84,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

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