From 809cbd113232eee77dd5a73520bb0608d7a00046 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 16 Apr 2018 21:31:47 +0200 Subject: bin/ii-connect: teach the buildmaster some respect for the devs --- bin/ii-connect | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'bin/ii-connect') diff --git a/bin/ii-connect b/bin/ii-connect index 030dd87..ca8ea99 100755 --- a/bin/ii-connect +++ b/bin/ii-connect @@ -49,6 +49,27 @@ if [ "$1" = 'watch' ]; then ) fi done_something=false + welcome_user_regex='^\S\+ -!- \(abaumann\|deep42thought\|tyzoid\)(.* has joined \S\+$' + new_users=$( + sed -n ' + s/'"${welcome_user_regex}"'/\1/ + T + p + ' "${irc_dir}/#archlinux32/out" | \ + sort -u + ) + if [ -n "${new_users}" ]; then + sed -i ' + /'"${welcome_user_regex}"'/ d + ' "${irc_dir}/#archlinux32/out" + done_something=true + printf '%s\n' "${new_users}" | \ + sed ' + s/^/Hi / + s/$/!/ + ' | \ + irc_say + fi find "${irc_dir}" \ -type f \ -name 'out' \ -- cgit v1.2.3