#! /bin/sh
#
# Set the path.
PATH=/sbin:/usr/sbin:/bin

# Accounting hosts in /etc/acct
if [ -f /tmp/account ]; then
	rm /tmp/account
fi
for f in /etc/acct/*; do
	i=`basename $f`
	/sbin/ipchains -L $i -v >> /tmp/account
done
# extract the accounting item and reorder it
logname=/var/log/account/account.`date +%b%d`
extract /tmp/account $logname
