2016-12-27 21:58:36 +00:00
|
|
|
{ pkgs, lib, ... }:
|
|
|
|
|
2023-07-08 12:50:48 +00:00
|
|
|
pkgs.writers.writeDashBin "irc-announce" ''
|
2016-12-27 21:58:36 +00:00
|
|
|
set -euf
|
|
|
|
|
|
|
|
IRC_SERVER=$1
|
|
|
|
IRC_PORT=$2
|
2019-04-28 13:01:50 +00:00
|
|
|
IRC_NICK=$3_$$
|
2016-12-27 21:58:36 +00:00
|
|
|
IRC_CHANNEL=$4
|
2021-09-05 20:51:37 +00:00
|
|
|
IRC_TLS=$5
|
|
|
|
message=$6
|
2016-12-27 21:58:36 +00:00
|
|
|
|
2021-10-05 21:09:44 +00:00
|
|
|
if test "$IRC_TLS" != 1; then
|
|
|
|
unset IRC_TLS
|
|
|
|
fi
|
|
|
|
|
|
|
|
printf %s "$message" |
|
|
|
|
${pkgs.ircaids}/bin/ircsink \
|
|
|
|
--nick="$IRC_NICK" \
|
|
|
|
--port="$IRC_PORT" \
|
|
|
|
--server="$IRC_SERVER" \
|
|
|
|
--target="$IRC_CHANNEL" \
|
|
|
|
''${IRC_TLS:+--secure}
|
2016-12-27 21:58:36 +00:00
|
|
|
''
|