#!/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