summaryrefslogtreecommitdiff
path: root/bin/ii-answer
diff options
context:
space:
mode:
Diffstat (limited to 'bin/ii-answer')
-rwxr-xr-xbin/ii-answer18
1 files changed, 17 insertions, 1 deletions
diff --git a/bin/ii-answer b/bin/ii-answer
index 40e40ea..e621682 100755
--- a/bin/ii-answer
+++ b/bin/ii-answer
@@ -17,7 +17,23 @@ for channel in '#archlinux32:Hi \0!\n!rq \0' '#archlinux32-devops:Hi \0!'; do
w /dev/stdout
d
' "${irc_dir}/${channel%%:*}/out" \
- | sort -u
+ | sort -u \
+ | grep -vxF "$(
+ {
+ printf '%s SNIP\n' $(($(date +%s)-5*60))
+ cat "${irc_dir}/out"
+ } \
+ | sort -k1nr,1 \
+ | sed '
+ /^\S\+ SNIP$/q
+ ' \
+ | sed '
+ s/^\S\+\s\+-!- \([^([:space:]]\+\)\((\S\+\)\? has quit.*$/\1/
+ t
+ d
+ ' \
+ | sort -u
+ )"
)
if [ -n "${new_users}" ]; then
printf '%s\n' "${new_users}" | \