Thread View: news.software.readers
3 messages
3 total messages
Started by Pseudo Silk Kimono
Mon, 27 Aug 2007 21:54
[slrn] Does the initial attempt to connect return a trappable code?
Author: Pseudo Silk Kimono
Date: Mon, 27 Aug 2007 21:54
Date: Mon, 27 Aug 2007 21:54
38 lines
2621 bytes
2621 bytes
Greetings,
Based on the recent outage on motzarella, I would like to create a
script which will attempt to connect to news.motzarella.org and if
it fails, attempt to use the other reader.motzarella.org and then
nntp.motzarella.org. I am not new to scripting and already have an idea
of how I want to do it. My question is, when I type slrn, it jumps
directly to the main "window". Is there a way to invoke slrn in such a
way that it does not immediatly display the main "window", rather it
would allow me to interogate a return code, or status so that I can
take action on a failed connection?
Plan
a) create 3 .slrnrc files, one for each of the motzarella servers
b) cp slrnrc_news .slrnrc
c) export NNTPSERVER=news.motzarella.org
d) try to connect to news.motzarella...
e) if it fails
i. cp slrnrc_reader .slrnrc
ii. export NNTPSERVER=reader.motzarella.org
iii. try to connect to reader.motzarella.org
iv. if it fails
A cp slrnrc_nntp .slrnrc
B export NNTPSERVER=nntp.motzarella.org
C try to connect to nntp.motzarella.org
D if it fails die
--
What were you? A jock or a brain?" http://blinkynet.net/comp/uip5.html
"I was a ghost." PSK - RLU 452647
Warrick Brown and Gil Grissom (Bully for You)
Re: [slrn] Does the initial attempt to connect return a trappable code?
Author: Blinky the Shark
Date: Mon, 27 Aug 2007 23:59
Date: Mon, 27 Aug 2007 23:59
96 lines
4515 bytes
4515 bytes
Pseudo Silk Kimono wrote:
> Greetings,
>
> Based on the recent outage on motzarella, I would like to create a
> script which will attempt to connect to news.motzarella.org and if
> it fails, attempt to use the other reader.motzarella.org and then
> nntp.motzarella.org. I am not new to scripting and already have an idea
> of how I want to do it. My question is, when I type slrn, it jumps
> directly to the main "window". Is there a way to invoke slrn in such a
> way that it does not immediatly display the main "window", rather it
> would allow me to interogate a return code, or status so that I can
> take action on a failed connection?
>
> Plan
>
> a) create 3 .slrnrc files, one for each of the motzarella servers
You need not have three complete rc's. Make one that has all of your
settings that aren't server-dependent (which will be 99% of slrnrc).
Make one for each server, with the server-dependent lines in it. Use
include statements in each of those to bring in, at slrn startup, the
non-server-dependent rc. That way, when you want to change a general
(non-server-dependent) setting, you only have to change it in one file.
> b) cp slrnrc_news .slrnrc
> c) export NNTPSERVER=news.motzarella.org
You need not keep changing NNTPSERVER. Run each server-version of slrn
from a shell script that includes the -h variable/argument.
Here's mine for news.individual.net:
#!/bin/bash
cleanscore -f ~/News/Score -e 2
rxvt -title 'Blinky NIN' +sb -e slrn -h news.individual.net
While yes, for slrn to run an NNTPSERVER environment variable seems
necessary, it's irrelevant what its value is if you run slrn with the
host variable.
> d) try to connect to news.motzarella...
> e) if it fails
> i. cp slrnrc_reader .slrnrc
> ii. export NNTPSERVER=reader.motzarella.org
Above.
> iii. try to connect to reader.motzarella.org
> iv. if it fails
> A cp slrnrc_nntp .slrnrc
> B export NNTPSERVER=nntp.motzarella.org
Above.
> C try to connect to nntp.motzarella.org
> D if it fails die
>From TFsM:
<q>
-h [snews://]host[:port]
Connect to the NNTP server on host, overriding the $NNTPSERVER
environment variable. If no port is given, the default NNTP port
(119) will be used. The prefix snews:// indicates that slrn should
attempt a secure connection. This will result in an error message
when SSL support is not compiled in. Like -p, this option is only
accepted after --nntp or when NNTP is the default mode.
</q>
>From TFsM:
<q>
include
Usage: include filename
You can use this command to load an additional file that contains
configuration commands. With this feature, you can easily keep startup
files for different key bindings, colors etc. filename is relative to
your home directory (see $SLRNHOME). This can safely be done multiple
times and recursively.
</q>
(My suggestion uses it the other way around, providing you with common
key bindings, colors etc., and providing multiple *host* setups.)
--
Blinky RLU 297263
Killing all posts from Google Groups
The Usenet Improvement Project: http://blinkynet.net/comp/uip5.html
Re: [slrn] Does the initial attempt to connect return a trappable code?
Author: Peter J Ross
Date: Wed, 29 Aug 2007 11:27
Date: Wed, 29 Aug 2007 11:27
36 lines
2089 bytes
2089 bytes
In news.software.readers on Mon, 27 Aug 2007 21:54:20 +0000 (UTC), Pseudo Silk Kimono <Pseudo_Silk_Kimono@marillion.com> wrote: > My question is, when I type slrn, it jumps > directly to the main "window". Is there a way to invoke slrn in such a > way that it does not immediatly display the main "window", rather it > would allow me to interogate a return code, or status so that I can > take action on a failed connection? $ slrn -w > Plan > > a) create 3 .slrnrc files, one for each of the motzarella servers This shouldn't be necessary. E.g.: #if$NNTPSERVER news.motzarella.org % options #endif #if$NNTPSERVER reader.motzarella.org % options #endif > b) cp slrnrc_news .slrnrc > c) export NNTPSERVER=news.motzarella.org > d) try to connect to news.motzarella... Would it not be quicker to ping the servers and set $NNTPSERVER to the first server that responds? -- PJR :-) <http://pjr.gotdns.org/verse/16-poems>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads