Article View: news.software.nntp
Article #3042Re: Accessing multiple nntp servers
From: Steven King, Software Archaeolog...
Date: Wed, 16 Nov 1994 20:01
Date: Wed, 16 Nov 1994 20:01
54 lines
2924 bytes
2924 bytes
simmons@EE.MsState.Edu publicly declared:
>Is there an elegant way to use two nntp servers for a site; one for
>local newsgroups, and one for USENET newsgroups? I administrate a
>system for a local high school, and would like to implement local
>newsgroups as a replacement for the primitive bbs system they have
>now. However, they use a nearby university's nntp server for their
>mainstream news. Spooling all their news locally is definately not an
>option, due to the limited bandwidth of their link and lack of disk
>space, and creating local newsgroups on the university's server is not
>an option for political reasons.
Simply create a wrapper script to link the proper .*rc file to .newsrc,
then call the newsreader of choice. Here, try this perl script:
#! /bin/perl
$localhost = "news.my.site.edu";
$nntpserver = $ARGV[0] || $ENV{'NNTPSERVER'} || $localhost;
$ENV{'NNTPSERVER'} = $nntpserver;
$newsreader = "$ENV{'NEWSREADER'}";
$newsrc = "$ENV{'HOME'}/.newsrc";
$localrc = "$ENV{'HOME'}/.localrc";
$remoterc = "$ENV{'HOME'}/.remoterc";
unlink($newsrc);
if ($nntpserver eq $localhost) {
symlink($newsrc,$localrc);
}
else {
symlink($newsrc,$remoterc);
}
exec($newsreader);
This is a little ditty I ran off in about 2 minutes. It's completely
untested. It could obviously use some more error checking (like not
unlinking the .newsrc file if it's a real file instead of a symlink!)
and could probably use some more bells and whistles.
It's not very elegant, no, but it is usable with any newsreader program.
More elegant solutions are possible with specific readers (like setting
trn's DOTDIR environment variable, for example), but those aren't
portable.
--
----------------------------------------------<Steven King, king@cig.mot.com>--
___
lim \/ 3 = 2
3->4
Technical Details
Message-ID:
<3ad8q2$34g@delphinium.cig.mot.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.admin.technical.mbox.zip!nntp.gmd.de!newsserver.jvnc.net!howland.reston.ans.net!swrinde!pipex!uunet!not-for-mailReferences:
<3a2dfk$478@Tut.MsState.Edu>Show Full Headers
Complete Article Headers
Message-ID: <3ad8q2$34g@delphinium.cig.mot.com> Subject: Re: Accessing multiple nntp servers Date: Wed, 16 Nov 1994 20:01:02 +0000 From: king@wildebeest.cig.mot.com (Steven King, Software Archaeologist) References: <3a2dfk$478@Tut.MsState.Edu> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.admin.technical.mbox.zip!nntp.gmd.de!newsserver.jvnc.net!howland.reston.ans.net!swrinde!pipex!uunet!not-for-mail Newsgroups: news.admin.technical,news.software.readers,news.software.nntp Organization: Cellular Infrastructure Group, Motorola Lines: 53 Sender: zorch@ftp.UU.NET Approved: zorch@uunet.UU.NET Distribution: world Reply-To: king@wildebeest.cig.mot.com NNTP-Posting-Host: ftp.uu.net