diff options
author | Ben Sima <ben@bsima.me> | 2020-12-30 20:32:03 -0500 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2020-12-30 20:32:03 -0500 |
commit | 55c7e1a340a9eddc230a8782b8487844e2876b0d (patch) | |
tree | f6add490a21ba616d841fff22388613478be158d /Biz/Bild/ShellHook.sh | |
parent | 0c8322ee39c2bfcb328656b3f666285482974c34 (diff) |
colorize sentry output
Diffstat (limited to 'Biz/Bild/ShellHook.sh')
-rw-r--r-- | Biz/Bild/ShellHook.sh | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/Biz/Bild/ShellHook.sh b/Biz/Bild/ShellHook.sh index a41d050..b42ab1d 100644 --- a/Biz/Bild/ShellHook.sh +++ b/Biz/Bild/ShellHook.sh @@ -87,17 +87,28 @@ function run-sentry() { https://simatime.com https://tv.simatime.com https://bsima.me + https://herocomics.app ) + RED='\033[0;31m' + GRN='\033[0;32m' + YEL='\033[0;33m' + NC='\033[0m' # No Color for url in ${urls[@]} do code=$(curl -L --max-time 10 --silent --show-error --insecure \ --output /dev/null \ --write-out "%{http_code}" "$url") - echo "$code $url" + case "$code" in + 2[0-9][0-9]) printf "${GRN}$code $url${NC}\n";; + 3[0-9][0-9]) printf "${YEL}$code $url${NC}\n";; + 4[0-9][0-9]) printf "${YEL}$code $url${NC}\n";; + 5[0-9][0-9]) printf "${RED}$code $url${NC}\n";; + *) printf "${RED}$code $url${NC}\n";; + esac done } export -f run-sentry -alias sentry="watch --exec bash -c run-sentry" +alias sentry="watch --color --exec bash -c run-sentry" # Poor man's ci function run-ci() { |