#!/bin/sh # # exec by m-ito # PATH=/usr/local/bin:/usr/local/sbin:/usr/local/news/bin:/usr/bin:/usr/sbin:/bin:/sbin export PATH # # base directory for catv # basedir=/provider/catv # # interval # interval=60m # # password file # PASSWDFILE=${basedir}/etc/passwd.nntp export PASSWDFILE # # Set News Server # #newsserver=news.cis.dfn.de newsserver=news.CATV.PROVIDER # # 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 # # forever loop # while [ X = X ] do # # Set News Group to get # newsgroup=`egrep -v '^#' ${basedir}/etc/newsgroup` # # Get News Group # cp /dev/null ${basedir}/tmp/getnews.tmp1.$$ # for i in ${newsgroup} do ### (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 done # # 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 for i in ${basedir}/tmp/*.newsartcl do rnews $i done fi # # Delete temporary files # rm -f ${basedir}/tmp/getnews.tmp*.$$ rm -f ${basedir}/tmp/0*.newsartcl rm -f ${basedir}/tmp/1*.newsartcl rm -f ${basedir}/tmp/2*.newsartcl rm -f ${basedir}/tmp/3*.newsartcl rm -f ${basedir}/tmp/4*.newsartcl rm -f ${basedir}/tmp/5*.newsartcl rm -f ${basedir}/tmp/6*.newsartcl rm -f ${basedir}/tmp/7*.newsartcl rm -f ${basedir}/tmp/8*.newsartcl rm -f ${basedir}/tmp/9*.newsartcl # sleep ${interval} done