#!/bin/sh -

log="${MICQLOG-$HOME/.icq/micq.log}"

# rollmicq - rollover the micq log file, summarizing and truncating it
# Steve Kinzler, steve@kinzler.com, Aug 98
# https://kinzler.com/me/home.html#web

case "$1" in
-h)	cat << EOF 1>&2
usage: $0 [ -k ]
	-k	keep the log file, ie don't truncate it
EOF
	exit 1;;
esac

sed '/ [12][0-9][0-9][0-9] User logged /d; /^[ 	]*$/d' < "$log" &&
case "$#" in
0)	> "$log";;
esac
