#!/bin/sh # # exec by news # PATH=/usr/local/bin:/usr/local/sbin:/usr/local/news/bin:/usr/bin:/usr/sbin:/bin:/sbin export PATH # # get lock # mkdir /tmp/getnews.sh.LOCK || exit 1 # # base directory for catv # basedir=~news/provider/catv # # password file # PASSWDFILE=${basedir}/etc/passwd.nntp export PASSWDFILE # # Set News Server # #newsserver=news.cis.dfn.de newsserver=news.catv.ne.jp # # Set GETCMD path # GETCMD=${basedir}/etc/recvnews.pl # # Set data directory for recvnews.pl # datadir=${basedir}/.recvnews # # Set timeout(sec) to get 1 line of article for recvnews.pl # timeout=30 # # Set max article number to get per one newsgroup for recvnews.pl # maxarticle=1000 #maxarticle=10 #---------------------------------------------------------------------- # # Set News Group to get # newsgroup=`egrep -v '^#' ${basedir}/etc/newsgroup` # # Get News Group # for i in ${newsgroup} do cp /dev/null ${basedir}/tmp/getnews.tmp1.$$ # ### (cd ${basedir}/etc; (\ ${GETCMD} ${newsserver} \ ${datadir} \ ${timeout} \ `echo "$i" | sed -e 's/,/ /g'` \ ${maxarticle} | \ egrep -v '^Xref:' >>${basedir}/tmp/getnews.tmp1.$$\ ) 2>&1 |\ tee ${datadir}/status # # Cut NewsLog into each articles (${basedir}/tmp/SEQUENCE.newsartcl) # (\ cd ${basedir}/tmp/ gawk -f ${basedir}/etc/getnews.awk ${basedir}/tmp/getnews.tmp1.$$ ) # # Send each articles to Innd # if [ ! -z ${basedir}/tmp/getnews.tmp1.$$ ] then touch ${basedir}/tmp/dummy.$$.newsartcl for i in ${basedir}/tmp/*.newsartcl do rnews $i rm -f $i done # rm -f ${basedir}/tmp/*.newsartcl fi done # # Delete temporary files # rm -f ${basedir}/tmp/getnews.tmp*.$$ # # release lock # rmdir /tmp/getnews.sh.LOCK