Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- # IRC Hilight Backlog by ed <irc.rizon.net>
- # BSD licensed -- 2014-07-31 -- v1.0
- #
- # Must be run with the same user as ZNC.
- # First argument (int) is day selector:
- # 0: Hilights from today (default),
- # 1: Hilights from one day ago...
- #
- # Line 17: Replace /ed/ with /your-username/
- # Lines 38-41: Modify to fit your needs
- #
- [ "x$1" == "x" ] && d=0 || d=$1
- dt=$(date +%Y%m%d --date="-$d day")
- cd ~/.znc/users/ed/moddata/log
- (
- ls -1 |
- grep "_$dt.log" |
- grep -v "#" |
- while read x
- do
- n=$(
- cat "$x" |
- grep -E "^...:..:... <ed> " -B1000 |
- wc -l
- )
- nn=$(
- cat "$x" |
- wc -l
- )
- n=$((nn-n))
- cat "$x" | tail -n $n
- done
- grep -P \
- "[Ll][Oo][Oo][Pp].?[Ss][Tt][Rr][Ee][Aa][Mm]|"\
- "[Tt][Rr][Ii][Pp][Ff][Ll][Aa][Gg]|"\
- "[^a-zA-Z0-9%<\x27]([Ee][Dd])([^a-zA-Z0-9%>]|$)|"\
- "[^a-zA-Z0-9][oO][cC][vV]([^a-zA-Z0-9]|$)" \
- --color=always *_$dt.log |
- grep -vE "] \*\*\* ..i.s:"
- ) |
- tee hil.tmp |
- (
- cat
- cat hil.$dt
- ) |
- sort |
- uniq -u |
- less -R
- read -n 1 -r -p "Hide these messages next time? [y/N]: "
- if [[ $REPLY =~ ^[Yy] ]]
- then
- cp hil.tmp hil.$dt
- else
- rm hil.tmp
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement