#
# for ipclassify

$Debug = $ENV{'LOGWATCH_DEBUG'} || 0;

if ( $Debug >= 5 ) {
   print STDERR "\n\nDEBUG: Inside ipclassify Filter \n";
}

$PID=`cat /var/run/ipclassify.pid`;
$STATFILE="/var/log/ipclassify.stats";

if ( $Debug >= 5 ) {
   print STDERR "DEBUG: ipclassify pid: $PID \n";
}
unlink($STATFILE);

if ( $Debug >= 5 ) {
   print STDERR "DEBUG: Dumping to StatsFile: $STATFILE \n";
}
system("kill -s USR1 $PID");
sleep(5);
open(SOURCE, "< $STATFILE")
    or die "Couldn't open $STATFILE for reading: $!\n";
while(<SOURCE>) { print "$_"; }
close(SOURCE);

if ( $Debug >= 5 ) {
   print STDERR "DEBUG: ipclassify done.\n\n";
}

