#!/bin/sh
#
# $Id: fetchiptables,v 1.2 2002/04/02 19:03:44 syatskevich Exp $
#
#    iptables.
#
#         /etc/cron.hourly
#     ,   
#        
#
#      /etc/init.d/loganalyzer 
#    shutdown

if [ ! -r "/etc/sysconfig/loganalyzer" ]; then
	echo "   .  $0 "
	exit 1
fi

# $USE_IPTABLES, $IPT_AIN, $IPT_AOUT
. /etc/sysconfig/loganalyzer

if [ "x$USE_IPTABLES" = "xyes" ]; then

	IPT_LOG=`mktemp /tmp/loganalyzer.XXXXXX`

	/sbin/iptables -L "$IPT_AIN"  -n -v -x -Z >> "$IPT_LOG"
	/sbin/iptables -L "$IPT_AOUT" -n -v -x -Z >> "$IPT_LOG"

	/usr/bin/loganalyzer iptables "$IPT_LOG"

	rm -f "$IPT_LOG"
fi
