diff options
author | lassulus <lassulus@lassul.us> | 2021-06-07 08:46:01 +0200 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2021-06-07 08:46:01 +0200 |
commit | bb79bf0ae8aeb47c6f6c74bf205ca43c74d42213 (patch) | |
tree | b3e32c66ee51b7862c29bcda1a1a324e58458834 | |
parent | 9d5bedb40485c55eb125c29cd609d725aee2c40c (diff) |
l radio: set irc topic
-rw-r--r-- | lass/2configs/radio.nix | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lass/2configs/radio.nix b/lass/2configs/radio.nix index 528d12069..040f5b943 100644 --- a/lass/2configs/radio.nix +++ b/lass/2configs/radio.nix @@ -83,6 +83,17 @@ let }' ''; + set_irc_topic = pkgs.writeDash "set_irc_topic" '' + ${pkgs.curl}/bin/curl -fsSv --unix-socket /home/radio/reaktor.sock http://z/ \ + -H content-type:application/json \ + -d "$(${pkgs.jq}/bin/jq -n \ + --arg text "$1" '{ + command:"TOPIC", + params:["#the_playlist",$text] + }' + )" + ''; + write_to_irc = pkgs.writeDash "write_to_irc" '' ${pkgs.curl}/bin/curl -fsSv --unix-socket /home/radio/reaktor.sock http://z/ \ -H content-type:application/json \ @@ -203,7 +214,7 @@ in { listeners=$(${pkgs.iproute}/bin/ss -Hno state established 'sport = :8000' | wc -l) echo "$(date -Is)" "$track" | tee -a "$HISTORY_FILE" echo "$(tail -$LIMIT "$HISTORY_FILE")" > "$HISTORY_FILE" - ${write_to_irc} "playing: $track listeners: $listeners" + ${set_irc_topic} "playing: $track listeners: $listeners" done ''; in { |