Article View: news.software.readers
Article #120928Re: Little OT: script to start slrn
From: J.B. Nicholson-Owens
Date: Thu, 27 Feb 2003 22:53
Date: Thu, 27 Feb 2003 22:53
58 lines
2938 bytes
2938 bytes
DjB wrote:
> I'm using slrn with 2 servers and now I'm looking to create a little
> script in which you can choose which server you want to use, eg: 1. isp
> 2. pay server...
If you have a modern shell (running anything made after roughly 1986) you
should be able to use:
alias slrn1='NNTPSERVER=my.isp.server slrn'
alias slrn2='NNTPSERVER=my.pay.server slrn'
then type "slrn1" or "slrn2" (or whatever names you change those to) to
select one server over another.
In your slrnrc, supply the lines so slrn can know which newsrc to maintain.
server my.isp.server .newsrc-my.isp.server
server my.pay.servre .newsrc-my.pay.server
> Also, is it possible to include a check if slrn is alread running, and
> display a message if this is the case ?
slrn already does this. You don't need to reimplement this. Try running
two instances of slrn at the same time to see what I mean.
> Must be very simple to make, but I'm an absolute beginner when it comes
> to scripting :(
I think the above is fairly simple. If you want to go beyond that, consider
doing the following in your slrnrc to allow different settings:[1]
#if$NNTPSERVER "my.isp.server"
set check_new_groups 1
#elseif$NNTPSERVER "my.pay.server"
set check_new_groups 0
#else
set check_new_groups 1
#endif
Which means if you're making slrn talk to my.isp.server, you will check for
new newsgroups. If you're making slrn talk to my.pay.server you will not
check for new newsgroups. If you're using any other server you will check
for new newsgroups. You can place as many slrnrc commands in between the
#if-#elseif-#else-#endif statements as you wish.
Happy newsreading.
[1] The example could be simplified to
#if$NNTPSERVER "my.pay.server"
set check_new_groups 0
#else
set check_new_groups 1
#endif
but I did it the above way to illustrate the #elseif construct.
Technical Details
Message-ID:
<slrnb5t7bl.stf.jbn@forestfield.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!freenix!deine.net!fu-berlin.de!uni-berlin.de!forestfield.ORG!not-for-mailReferences:
<slrnb5pdt1.2at.dick@dbhome.bolderman.xs4all.nl>Show Full Headers
Complete Article Headers
Message-ID: <slrnb5t7bl.stf.jbn@forestfield.org> Subject: Re: Little OT: script to start slrn Date: Thu, 27 Feb 2003 22:53:22 +0000 From: "J.B. Nicholson-Owens" <jbn@forestfield.org> References: <slrnb5pdt1.2at.dick@dbhome.bolderman.xs4all.nl> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!freenix!deine.net!fu-berlin.de!uni-berlin.de!forestfield.ORG!not-for-mail Newsgroups: news.software.readers Organization: Forest Field OmniMedia Lines: 57 NNTP-Posting-Host: forestfield.org (208.216.67.173) X-Trace: fu-berlin.de 1046386402 58228424 208.216.67.173 (16 [35848]) Mail-Copies-To: nobody User-Agent: slrn/0.9.7.4pl2 (GNU/Linux)