#!/bin/sh
# Quick hack to redo the stats for a domain based on all the existing log
# information.
host=$1
cd /hosts
(cd $host/logs
ls access.log* | sort -n -k 1.12 -r | while read log ; do
	if [ "$log" = "`basename $log .gz`" ] ; then
		cat $log
	else
		zcat $log
	fi
done) >/tmp/log.$$
/opt/webalizer/bin/webalizer -p -N 20 -D /var/run/webalizer-dns-cache.db -n $host -o $host/stats /tmp/log.$$
rm -f /tmp/log.$$

