-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathirclogger_totml
executable file
·53 lines (44 loc) · 1.18 KB
/
irclogger_totml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
# $1=channel $2=date('%Y-%m-%d,%a') $3=selected_line $4=config_file $5=header
# $6=filename
set -a
shopt -s extglob
CHAN=$1
if test -e "$4"; then conffile="$4"; . "${conffile%/*}/irclogger_common"
else logsdir=${logsdir:-/var/log/irclogger}
fi
case "$6" in /*)logfile="$6";; *)logfile="$PWD/$6";;
esac
cd $logsdir
omn=-100
owho=""
iseven=true
eol=""
echo "<!-- Some styling for better description lists --><style type='text/css'>dt { font-weight: bold;float: left;display:inline;margin-right: 1em} dd { display:block; margin-left: 2em}</style>";echo
sed -e '{
s/&/\&/g
s/</\</g
s/>/\>/g
}' | ( read; curline=1 # 1st line is join of the bot
while read -r time who text;do
let curline=curline+1
if [ "$who" = "*" ]; then who="-"; fi
if [ "$who" = "<WebGate>" -o "$who" = "Webgate" ]; then
who="${text%%]*}"; who="${who#[}"; text="${text#*] }"
fi
who="${who%>}";who="${who#<}"
case "$text" in
+([a-zA-Z_0-9]):\ *) text="<u>${text/:/</u>:}";;
esac
if [ "$who" = "$owho" ]; then
echo " <br> $text"
else
owho="$who"
echo " $who: $text"
fi
done)
exit 0
### EMACS MODES
### Local Variables: ***
### mode:ksh ***
### End: ***