#!/usr/bin/perl --

# To be run by the news admin from the shell. Prints the current
# status of an outgoing funnel feed.
#
# John Milburn 97.4.7
# -jem@xpat.com

#### =()<require '@<_PATH_PERL_SHELLVARS>@';>()=
require '/var/news/etc/innshellvars.pl';

$seen = 0;
$feed = shift;
die "usage: feedstat <site>\n" unless $feed;
$status = "$inn::batch/innfeed.status";

open (ILOG, "< $status") || die "Cannot open $status file: $!";

while ( <ILOG> ) {
	next unless /^$feed/;
	$seen = 1;
	print $_;
	while ( <ILOG> ) {
		next if /^\s*$/;
		last if /^[a-zA-Z]/;
		print $_;
	}
	last;
}
unless ( $seen ) {
	print "No entry for feed $feed found in $status\n";
}

exit 0;
