summaryrefslogtreecommitdiff
path: root/bin/ii-answer
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2021-05-23 23:14:59 +0200
committerErich Eckner <git@eckner.net>2021-05-23 23:14:59 +0200
commit970a46f8a63a0032a8558b78d32c09aac0ce3aa2 (patch)
tree754c09490abef8e7a8095310773d118bd94c546e /bin/ii-answer
parent41e0306767c46a6d371f7f560a411d743600fc91 (diff)
downloadbuilder-970a46f8a63a0032a8558b78d32c09aac0ce3aa2.tar.xz
move to irc.libera.chat and #archlinux32-devops (mostly)
Diffstat (limited to 'bin/ii-answer')
-rwxr-xr-xbin/ii-answer38
1 files changed, 20 insertions, 18 deletions
diff --git a/bin/ii-answer b/bin/ii-answer
index ffaa08b..3077311 100755
--- a/bin/ii-answer
+++ b/bin/ii-answer
@@ -7,25 +7,27 @@
# shellcheck source=../lib/load-configuration
. "${0%/*}/../lib/load-configuration"
-# welcome devs (in #archlinux32 only)
+# welcome devs (in #archlinux32 and #archlinux32-devops only)
welcome_user_regex='^\S\+ -!- \(abaumann\|buildmaster\|deep42thought\|girls\|nit-picker\|tyzoid\)(.* has joined \S\+$'
-new_users=$(
- sed -i '
- s/'"${welcome_user_regex}"'/\1/
- T
- w /dev/stdout
- d
- ' "${irc_dir}/#archlinux32/out" | \
- sort -u
-)
-if [ -n "${new_users}" ]; then
- printf '%s\n' "${new_users}" | \
- sed '
- s/^.*$/Hi \0!\n!rq \0/
- s/Hi buildmaster!\n//
- ' | \
- irc_say '' 'copy'
-fi
+for channel in '#archlinux32' '#archlinux32-devops'; do
+ new_users=$(
+ sed -i '
+ s/'"${welcome_user_regex}"'/\1/
+ T
+ w /dev/stdout
+ d
+ ' "${irc_dir}/${channel}/out" | \
+ sort -u
+ )
+ if [ -n "${new_users}" ]; then
+ printf '%s\n' "${new_users}" | \
+ sed '
+ s/^.*$/Hi \0!\n!rq \0/
+ s/Hi buildmaster!\n//
+ ' | \
+ irc_say "${channel}" 'copy'
+ fi
+done
find "${irc_dir}" \
-type f \