citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

commit 634a7279d20782f38ea832005689db839d32345c
parent 5f08663ad7ae1cceba3775dee8bf3a9f03986215
Author: William Casarin <jb55@jb55.com>
Date:   Sun,  8 Nov 2020 12:25:27 -0800

bin: fix alerts

Diffstat:
Abin/httpalert | 10++++++++++
Mbin/sendalert | 10++++++++--
2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/bin/httpalert b/bin/httpalert @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +awk '/67e43f8b407c53e6c5a7aaa38a1ec8e9/ { OK=1 } /^$/ { if (OK == 1) GO=1 } GO==1 { print $0 }' | + jq -r '.payload | "circleci - \(.workflows.job_name) - \(.reponame) - \(.outcome)"' | + /home/jb55/bin/sendalert + +printf 'HTTP/1.0 200\n' +printf 'Content-Type: text/plain\n' +printf 'Content-Length: 0\n' +printf '\n' diff --git a/bin/sendalert b/bin/sendalert @@ -1,3 +1,9 @@ #!/usr/bin/env sh -gpg --encrypt -r 0xDC6893B47083300CB7A47A76A7441FAF7C898CAB > /tmp/alert -</tmp/alert nc -uw0 monad.jb55.com 55000 +gpg --encrypt -r DC6893B47083300CB7A47A76A7441FAF7C898CAB > /tmp/alert +if [ $(hostname) = "charon" ] +then + ENDPOINT=monad.endpoint.jb55.com +else + ENDPOINT=monad.jb55.com +fi +</tmp/alert nc -uw0 $ENDPOINT 55000