From 4d33f2ebea49e258f833cb6eab0c71485e88397a Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 29 May 2022 00:38:45 +0200 Subject: l prism.r: add binaergewitter bot --- lass/2configs/bgt-bot/bgt-check.sh | 57 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 lass/2configs/bgt-bot/bgt-check.sh (limited to 'lass/2configs/bgt-bot/bgt-check.sh') diff --git a/lass/2configs/bgt-bot/bgt-check.sh b/lass/2configs/bgt-bot/bgt-check.sh new file mode 100644 index 000000000..30185ba18 --- /dev/null +++ b/lass/2configs/bgt-bot/bgt-check.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# needs in path: +# curl gnugrep jq +# creates and manages $PWD/state +set -xeuf + +send_reaktor(){ + # usage: send_reaktor "text" + echo "send_reaktor: $1" + curl -fsS "http://localhost:$REAKTOR_PORT" \ + -H content-type:application/json \ + -d "$(jq -n \ + --arg text "$1" \ + --arg channel "$IRC_CHANNEL" \ + '{ + command:"PRIVMSG", + params:[$channel,$text] + }' + )" +} + +live=$(shuf -n1 < state +fi -- cgit v1.2.3