citadel

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

commit aace011ecebc74832d33da1d6d6bc8f28418079f
parent f75f019c8dfe9521726ea7b6d65c30785e192c88
Author: William Casarin <jb55@jb55.com>
Date:   Thu,  8 Oct 2020 12:15:43 -0700

bin/recvalert: relay to laptop

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Mbin/recvalert | 14+++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/bin/recvalert b/bin/recvalert @@ -1,3 +1,15 @@ #!/usr/bin/env bash -gpg --decrypt | xargs -I{} notify-send -u critical "{}" +set -e + +PAYLOAD=$(gpg --decrypt) + +# relay to laptop +if [ $(hostname) == "monad" ]; then + printf "sending to laptop\n" + tmp=$(mktemp) + <<<"$PAYLOAD" gpg --encrypt -r quiver > "$tmp" + <"$tmp" nc -uw0 10.100.0.2 55000 + rm -f "$tmp" +fi +<<<"$PAYLOAD" xargs -I{} notify-send -u critical "{}"