Rhlug (IRC)

From RHLUG

Jump to: navigation, search

Some of us hang out in #rhlug on irc.freenode.net. Feel free to stop by using Pidgin or your IRC client of choice.

If you are unfamiliar with IRC you can log in using the web based client.

logs from the channel and up to date code are also accessible at http://lug.rose-hulman.edu/irc/. For a prettier version of the logs, visit the logview.

[edit] Luglog code

This is the source code for the logger, if anyone's interested.

File: luglog.sh
#!/bin/bash

NICK="luglog"
SERVER="irc.freenode.net"
CHAN="#rhlug"

CMD="/tmp/luglog.cmd"
FIFODIR="/tmp/logview_fifos"
LOGDIR="logs"
FMTCMD="date +%Y-%m.log"

[ -e $FIFODIR ] || install -g apache -m 775 -d $FIFODIR
[ -e $CMD     ] || mkfifo $CMD

# attempt to restart after netcuts and timeouts
while true; do
	cat $CMD |
	/usr/local/bin/sic -h $SERVER -n $NICK | 
	while read -r line; do
		echo "DEGUG: $line" 1>&2
		if [[ "$line" =~ ^$NICK.*VERSION ]]; then
			echo "JOINING CHANNEL" 1>&2
			echo ":j $CHAN"
		fi
		if [[ "$line" =~ ^($CHAN.*|.*>< (JOIN|QUIT|KICK|MODE|PART|NICK)) ]]; then
			log=$LOGDIR/$($FMTCMD)
			echo "LOGGING LINE TO [$log]" 1>&2
			echo "$line" | tee "$FIFODIR/*" >> "$log"
		fi
	done > $CMD
	sleep 30
done
Personal tools