sermoni

"Service monitor" / cronjob status service
Log | Files | Refs

commit 6527e5a577184761f7bdca137ef7a58505dd2fac
parent 792c86c6a3bac96d2b35e522a02af6b4f4a44523
Author: Vetle Haflan <vetle@haflan.dev>
Date:   Fri, 10 Sep 2021 12:03:22 +0200

feat: add a NO_DETAILS option to sermonic part of setup.sh

Diffstat:
Minternal/http/setup.sh | 13+++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/internal/http/setup.sh b/internal/http/setup.sh @@ -166,15 +166,24 @@ if [ $RESULT -ne 0 -o -s "$ERR" ]; then out "TRACE-ERROR OUTPUT:" out $(cat "$TRACE") fi - details=$(json_escape "$(cat $FULLDETAILS)") + if [ -n "$NO_DETAILS" ]; then + details="Details written to $FULLDETAILS" + else + details=$(json_escape "$(cat ${FULLDETAILS})") + fi status=error title="'$(basename $2)' failed" else - details=$(json_escape "$(cat $OUT)") + if [ -n "$NO_DETAILS" ]; then + details="Details written to $OUT" + else + details=$(json_escape "$(cat ${OUT})") + fi status=ok title="'$(basename $2)' finished successfully" fi + sermonicli report $SERVICEID $status "$title" "$details" rm -rf "$TMP"