diff options
| author | tv <tv@krebsco.de> | 2026-01-11 20:55:04 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-01-11 20:55:04 +0100 |
| commit | 114a129b977863db2cba719fca1e213f518ca3b1 (patch) | |
| tree | b029c1ee96dc160c9c6f0e3ab623e4707de70c74 /krebs/5pkgs/simple/reaktor2-plugins/scripts/tell-on_privmsg.sh | |
| parent | f60ccbad0558542b0a803c6947f98f393facad1e (diff) | |
| parent | 68d3c925b0edb958fcbafa589d35967dfb2a979c (diff) | |
Diffstat (limited to 'krebs/5pkgs/simple/reaktor2-plugins/scripts/tell-on_privmsg.sh')
| -rwxr-xr-x | krebs/5pkgs/simple/reaktor2-plugins/scripts/tell-on_privmsg.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/krebs/5pkgs/simple/reaktor2-plugins/scripts/tell-on_privmsg.sh b/krebs/5pkgs/simple/reaktor2-plugins/scripts/tell-on_privmsg.sh new file mode 100755 index 000000000..fc05bdefb --- /dev/null +++ b/krebs/5pkgs/simple/reaktor2-plugins/scripts/tell-on_privmsg.sh @@ -0,0 +1,18 @@ +#! /bin/sh +set -euf + +# require flock from util-linux +if test "${FLOCK-}" != "$state_file"; then + exec env FLOCK="$state_file" flock "$state_file" "$0" "$@" +fi + +# TODO tell now, if already joined +jq -cn \ + --arg from "$_from" \ + --arg to "${1%% *}" \ + --arg text "${1#* }" \ + --arg msgtarget "$_msgtarget" \ + '{ $from, $to, $text, $msgtarget, date: (now | todate) }' \ + >> "$state_file" + +echo 'Consider it noted.' # that's what lambdabot says... |
