From 1527d6856f33b4993374785750bbef5e6350d9f7 Mon Sep 17 00:00:00 2001 From: TheBigRoomXXL Date: Sun, 3 Sep 2023 17:23:25 +0200 Subject: [PATCH] Support reporting errors on stderr --- tinystatus | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tinystatus b/tinystatus index 42dd45e2d..f167ec400 100755 --- a/tinystatus +++ b/tinystatus @@ -7,6 +7,7 @@ tmp="$(mktemp -d)" checkfile="${1:-checks.csv}" incidentsfile="${2:-incidents.txt}" failonoutage=false +reportonoutage=false useragent="User-Agent: Mozilla/5.0 (X11; Linux x86_64; Debian) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" command_exists(){ @@ -101,6 +102,9 @@ for file in "${tmp}/ko/"*.status; do name="$(basename "${file}" | sed 's,.status$,,')" status="$(cat "${file}")" echo "
  • ${name} (${status})Disrupted
  • " + if [ "${reportonoutage}" = true ]; then + echo "${name} (${status})" >&2 + fi done for file in "${tmp}/ok/"*.status; do [ -e "${file}" ] || continue