#! /bin/sh -e
# sync-from-isc -- synchronize active file with Internet Software Consortium
# Author: tale@isc.org (David Lawrence)

# This program retrieves the active and newsgroups files which are maintained
# at the Internet Software Consortium.  The files are updated according
# to the policy described in the README document there.  We recommend
# using these files because they are more conscientously maintained than
# other files which simply list every group for which a newgroup control
# message was ever sent.

# This program needs ncftp to work; you can get it from 
# ftp://ftp.probe.net/pub/ncftp.  If you install it in /usr/local/bin,
# or some other PATH not normally in the PATH created by innshellvars,
# you will probably need to uncomment the PATH= line below.

#  =()<. @<_PATH_SHELLVARS>@>()=
. /var/news/innshellvars

#PATH=$PATH:/usr/local/bin

cd $TMPDIR

ncftp ftp://ftp.isc.org/pub/usenet/CONFIG/active
ncftp ftp://ftp.isc.org/pub/usenet/CONFIG/newsgroups

# =()<actsync -i @<_PATH_ACTSYNC_IGN>@> -v 0 ./active | sh()=
actsync -i /var/news/actsync.ign -v 0 ./active | sh

mv newsgroups $NEWSLIB/newsgroups.new
ln $NEWSLIB/newsgroups $NEWSLIB/newsgroups.old
mv $NEWSLIB/newsgroups.new $NEWSLIB/newsgroups

rm -f active

exit 0


