Article View: news.software.readers
Article #11194Script for Tin over NNTP
From: Bruce Momjian
Date: Sun, 11 Sep 1994 01:33
Date: Sun, 11 Sep 1994 01:33
81 lines
3076 bytes
3076 bytes
I use Tin 1.2PL2 over a 14.4k PPP connection to read news via NNTP. Here are two Unix shell script to make starting up tin easy. They allow you to control which news groups get loaded upon startup. In its default configuration, without flags, tin reads the entire remote active file. This is usually abuot 2000 lines or 150k of data. Over such a connection, startup can be slow. My scripts allow you to control this easily: rtino - runs tin and only loads the groups you subscribe to rtina - load all groups rtinf - loads groups matching the pattern you supply rtinf needs a recent copy of the remote site's active file. The scripts also attempt to prevent you from running tin multiple times on the same .newsrc file. They do nothing tin can not already do, they just make it easier. I have used them for several month, and though they may be of some use to someone. --------------------------------------------------------------------------- #!/bin/sh # # rtino, rtina - save under both names or link them # #set -x BASE=`basename $0` BASE2=$BASE [ "$BASE" = "rtina" ] && BASE2="rtino" trap "rm -f $HOME/.$BASE2.in_use" 0 1 2 3 15 if [ -f $HOME/.$BASE2.in_use ] then echo "Tin is already in use on \c" >&2 cat $HOME/.$BASE2.in_use >&2 trap "" 0 1 2 3 15 exit 1 fi tty > $HOME/.$BASE2.in_use OPT="-f $HOME/.newsrc" [ "$BASE" = rtino ] && OPT="$OPT -qn " # -U [ "$BASE" = rtina ] && BASE=rtin && OPT="$OPT -q" tin -r $OPT "$@" --------------------------------------------------------------------------- #!/bin/sh # # rtinf # the -a option adds groups to your default .newsrc # # # define this as your remote site's active file # NNTPACTIVE=/usr/local/nntp.active # # trap "rm -f $HOME/.newsrcf.$$" 0 1 2 3 15 ADD="N" [ "$1" = "-a" ] && ADD="Y" && shift [ "$#" -ne 1 ] && echo "Usage: $0 [-a] group_pattern" 1>&2 && exit 1 sed 's/^\([^ ]*\).*$/\1: /' $NNTPACTIVE | grep "$1" >$HOME/.newsrcf.$$ shift if [ "$ADD" = "N" ] then tin -r -qn -f $HOME/.newsrcf.$$ "$@" else cat $HOME/.newsrcf.$$ >>$HOME/.newsrc fi -- Bruce Momjian | 830 Blythe Avenue root@candle.pha.pa.us | Drexel Hill, Pennsylvania 19026 + If your life is a hard drive, | (610) 353-9879(w) + Christ can be your backup. | (610) 853-3000(h)
Technical Details
Message-ID:
<34tmoe$6p6@nova.voicenet.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!nntp.gmd.de!newsserver.jvnc.net!news.cac.psu.edu!news.pop.psu.edu!psuvax1!news.cc.swarthmore.edu!netnews.upenn.edu!nova.voicenet.com!rootShow Full Headers
Complete Article Headers
Message-ID: <34tmoe$6p6@nova.voicenet.com> Subject: Script for Tin over NNTP Date: Sun, 11 Sep 1994 01:33:02 +0000 From: root@candle.pha.pa.us (Bruce Momjian) Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!nntp.gmd.de!newsserver.jvnc.net!news.cac.psu.edu!news.pop.psu.edu!psuvax1!news.cc.swarthmore.edu!netnews.upenn.edu!nova.voicenet.com!root Newsgroups: news.software.readers,news.software.nntp Organization: a consultant's basement Lines: 81 Distribution: inet NNTP-Posting-Host: candle-slip.voicenet.com X-Newsreader: TIN [version 1.2 PL2]