summaryrefslogtreecommitdiffstats
path: root/lass/2configs/bgt-bot/bgt-check.sh
diff options
context:
space:
mode:
authorlassulus <git@lassul.us>2023-09-07 12:26:31 +0200
committerlassulus <git@lassul.us>2023-09-07 12:40:43 +0200
commit2e5167de1560ad0d7b8e294c72e1913f694160c2 (patch)
treeb618daa9f125650e9276bae7848f854c48d6c95e /lass/2configs/bgt-bot/bgt-check.sh
parent6a3a423dad19264c0c42821c7676e85ecc122d21 (diff)
lass: migrate awayriplass
Diffstat (limited to 'lass/2configs/bgt-bot/bgt-check.sh')
-rw-r--r--lass/2configs/bgt-bot/bgt-check.sh57
1 files changed, 0 insertions, 57 deletions
diff --git a/lass/2configs/bgt-bot/bgt-check.sh b/lass/2configs/bgt-bot/bgt-check.sh
deleted file mode 100644
index 30185ba18..000000000
--- a/lass/2configs/bgt-bot/bgt-check.sh
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/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 <<EOF
-Binärgewitter Liveshow hat begonnen! http://stream.radiotux.de:8000/binaergewitter.mp3
-EOF
-)
-
-offline=$(shuf -n1 <<EOF
-Live stream vorbei
-EOF
-)
-error=$(shuf -n1 <<EOF
-something went wrong
-EOF
-)
-
-if curl -Ss http://stream.radiotux.de:8000 | grep -q 'Mount Point /binaergewitter'; then
- state='live'
-else
- state='offline'
-fi
-prevstate=$(cat state ||:)
-
-if test "$state" == "$(cat state)";then
- #echo "current and last state is the same ($state), doing nothing"
- :
-else
- echo "API state and last state differ ( '$state' != '$prevstate')"
- if test "$state" == 'live';then
- send_reaktor "$live"
- elif test "$state" == 'offline';then
- send_reaktor "$offline"
- else
- send_reaktor "$error"
- fi
- echo 'updating state'
- printf "%s" "$state" > state
-fi