#!/bin/sh
# Update "Other" newsgroups
#
data=../../../DataSources/News
tools=.
date=`date | awk '{printf "%s-%s-%02d\n", $6, $2, $3}'`
echo "
Other news groups" > $data/OtherGroups/Overview.html.new
echo "Other News Groups
" >> $data/OtherGroups/Overview.html.new
echo "Newsgroups available on" `hostname` on `date` "." >> $data/OtherGroups/Overview.html.new
echo "Your site may have access to different groups." >> $data/OtherGroups/Overview.html.new
egrep -v "^alt|^bionet|^bit|^biz|^cern|^ch|^eunet|^gnu|^news|^comp\
|^pubnet|^rec|^sci|^soc|^talk|^vmsnet|^misc|^!" '/usr/local/lib/news/newsgroups' | sort | awk '{print $1}' | awk -F'.' 'BEGIN {currgrp = $1}
{ if ($1!=currgrp) {
currgrp=$1;
printf ("%s\n",$1);
}
}' > $data/OtherGroups/stems
cat $data/OtherGroups/stems | $tools/GrpCreate
diff $data/OtherGroups/Overview.html $data/OtherGroups/Overview.html.new >> $data/OtherGroups/Overview-diffs-$date.diffs
mv $data/OtherGroups/Overview.html $data/OtherGroups/Overview.html.old
mv $data/OtherGroups/Overview.html.new $data/OtherGroups/Overview.html