#!/bin/sh
if [ ! -r /etc/openfwtk.conf ]; then
    echo "Error: /etc/openfwtk.conf file is not exist or access to it is denied" 1>&2
    exit 1
fi
. /etc/openfwtk.conf
if [ "$OFWTKPATH" = "" ]; then
    echo "Error: OFWTKPATH is empty" 1>&2
    exit 1
fi

cat >/tmp/topserv.$$
echo "*** HTTP usage by destination"
echo
$OFWTKPATH/bin/squid-log </tmp/topserv.$$| $OFWTKPATH/bin/squid-top -n 20
echo
echo "*** NNTP usage by newsgroup"
echo
$OFWTKPATH/bin/nntp-top -n 20 </tmp/topserv.$$
rm /tmp/topserv.$$
