#!/bin/sh
#
# This file is part of SnarfNews
# Copyright (C) 1991,1992,1993,1994,1995,1996 Alec Muffett
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#

date=`date "+%y%m%d%H%M%S"`
cookie=$date$$

cd $SNARFOUT  || exit 1

for feed in $@
do
#   cp $feed $feed.$cookie || exit 1
    mv $feed $feed.$cookie || exit 1
    if ctlinnd flush $feed 1>&2
    then
    	gronkfiles < $feed.$cookie
    	rm -f $feed.$cookie
    fi
done

exit 0
