From 78fd07cb80f1b417fe2994c169bddc691750fefb Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 5 Oct 2012 09:34:33 -0400 Subject: [PATCH] Add a test tool. --- Makefile | 2 +- irk | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100755 irk diff --git a/Makefile b/Makefile index 6f66403..f77624c 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,7 @@ loc: @echo -n "LLOC: "; grep -vE '(^ *#|^ *$$)' irkerd irkerhook.py | wc -l SOURCES = README COPYING NEWS install.txt security.txt hacking.txt \ - irkerd irkerhook.py filter-example.py filter-test.py \ + irkerd irkerhook.py filter-example.py filter-test.py irk \ Makefile irkerd.xml irkerhook.xml EXTRA_DIST = irker-logo.png org.catb.irkerd.plist diff --git a/irk b/irk new file mode 100755 index 0000000..2ccab51 --- /dev/null +++ b/irk @@ -0,0 +1,17 @@ +#!/bin/sh +# Illustrates how to test irkerd. +# +# First argument must be a channel URL. If it does not begin with "irc", +# the base URL for freenode is prepended. +# +# Second argument must be a payload string. +# +channel=$1 +message=$2 + +case $channel in +irc:*) ;; +*) channel="irc://chat.freenode.net/$channel" +esac + +echo "{\"to\":\"$channel\",\"privmsg\":\"$message\"}" | netcat localhost 6659 -- 2.26.2