Thread View: news.software.readers
30 messages
30 total messages
Started by DjB
Wed, 26 Feb 2003 12:46
Little OT: script to start slrn
Author: DjB
Date: Wed, 26 Feb 2003 12:46
Date: Wed, 26 Feb 2003 12:46
18 lines
1370 bytes
1370 bytes
Hi, 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... Also, is it possible to include a check if slrn is alread running, and display a message if this is the case ? Must be very simple to make, but I'm an absolute beginner when it comes to scripting :( Thanks -- DjB (remove nospam.please. to reply)
Re: Little OT: script to start slrn
Author: Markku Lehtola
Date: Wed, 26 Feb 2003 12:53
Date: Wed, 26 Feb 2003 12:53
26 lines
1675 bytes
1675 bytes
In article <slrnb5pdt1.2at.dick@dbhome.bolderman.xs4all.nl>, DjB wrote: > Hi, > > 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... > > Also, is it possible to include a check if slrn is alread running, and > display a message if this is the case ? > > Must be very simple to make, but I'm an absolute beginner when it comes > to scripting :( > > Thanks > Isn't it easier to create 2 different scripts instead of one? "another beginner with any kind of programming..;-)" -- www.markkulehtola.net
Re: Little OT: script to start slrn
Author: Markku Lehtola
Date: Wed, 26 Feb 2003 12:55
Date: Wed, 26 Feb 2003 12:55
27 lines
1652 bytes
1652 bytes
In article <slrnb5pdt1.2at.dick@dbhome.bolderman.xs4all.nl>, DjB wrote: > Hi, > > 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... > > Also, is it possible to include a check if slrn is alread running, and > display a message if this is the case ? > > Must be very simple to make, but I'm an absolute beginner when it comes > to scripting :( > > Thanks > another beginner here ;-) Isn't it easier to create own script for every server? -- www.markkulehtola.net
Re: Little OT: script to start slrn
Author: DjB
Date: Wed, 26 Feb 2003 12:57
Date: Wed, 26 Feb 2003 12:57
25 lines
1946 bytes
1946 bytes
* Markku Lehtola <markku@markkulehtola_NOSPAM.net>: > In article <slrnb5pdt1.2at.dick@dbhome.bolderman.xs4all.nl>, 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... >> >> Also, is it possible to include a check if slrn is alread running, and >> display a message if this is the case ? >> >> Must be very simple to make, but I'm an absolute beginner when it comes >> to scripting :( > Isn't it easier to create 2 different scripts instead of one? Well, I could create 2 scripts, but one is nicer :) And depending on which location I am, I also want to be able to include color/mono options, and so on. So if I have an example of how to make such script, I can easy extend it mself. -- DjB (remove nospam.please. to reply)
Re: Little OT: script to start slrn
Author: Don Todd
Date: Wed, 26 Feb 2003 13:47
Date: Wed, 26 Feb 2003 13:47
22 lines
1759 bytes
1759 bytes
In article <slrnb5pdt1.2at.dick@dbhome.bolderman.xs4all.nl>, DjB wrote: > Hi, > > 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... > > Also, is it possible to include a check if slrn is alread running, and > display a message if this is the case ? > > Must be very simple to make, but I'm an absolute beginner when it comes > to scripting :( > > Thanks Lo, How do you tell slrn which server to use, by exporting the NNTPSERVER variable or with a resource file? Todd
Re: Little OT: script to start slrn
Author: SINNER
Date: Wed, 26 Feb 2003 13:50
Date: Wed, 26 Feb 2003 13:50
40 lines
2998 bytes
2998 bytes
While strolling through news.software.readers, DjB was overheard plotting: > * Markku Lehtola <markku@markkulehtola_NOSPAM.net>: >> In article <slrnb5pdt1.2at.dick@dbhome.bolderman.xs4all.nl>, 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... >>> >>> Also, is it possible to include a check if slrn is alread running, and >>> display a message if this is the case ? >>> >>> Must be very simple to make, but I'm an absolute beginner when it comes >>> to scripting :( > >> Isn't it easier to create 2 different scripts instead of one? > > Well, I could create 2 scripts, but one is nicer :) And depending on > which location I am, I also want to be able to include color/mono > options, and so on. So if I have an example of how to make such script, > I can easy extend it mself. > > Well I see one of 2 ways to accomplish same. 1) have to slrnrc files named differently and use the script to start it. slrn -f /path/to/slrnrc.1 etc OR have the script prompt you with <STDIN> and you tell it which file to use. the former requires 2 scripts, the latter only 1. I am no script writer but it sounds like a 2 or 3 liner at best. 2) use leafnode to grab groups and articles from all servers in one place so you can read everything in one copy of slrn. Leafnode is a local newsserver in the event you hadn't heard of it. HTH -- David if it GLISTENS, gobble it!!
Re: Little OT: script to start slrn
Author: Rupert
Date: Wed, 26 Feb 2003 14:10
Date: Wed, 26 Feb 2003 14:10
25 lines
1568 bytes
1568 bytes
In article <slrnb5pdt1.2at.dick@dbhome.bolderman.xs4all.nl>, 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... -- cut here -- #!/bin/sh export NNTPSERVER="$1" slrn -- cut here -- Then run myscript nntp.isp.com or myscript nntp.pay.server.com > Also, is it possible to include a check if slrn is alread running, > and display a message if this is the case ? My slrn complains if there's another copy running anyway. Anyway, the better solution would probably be to use leafnode as someone else suggested. HTH, Rupert
Re: Little OT: script to start slrn
Author: Don Todd
Date: Wed, 26 Feb 2003 14:36
Date: Wed, 26 Feb 2003 14:36
42 lines
2233 bytes
2233 bytes
In article <slrnb5pdt1.2at.dick@dbhome.bolderman.xs4all.nl>, DjB wrote: > Hi, > > 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... > > Also, is it possible to include a check if slrn is alread running, and > display a message if this is the case ? > > Must be very simple to make, but I'm an absolute beginner when it comes > to scripting :( > > Thanks How about this? Haven't tested it, so big disclaimer. Call the script. -f switch for free server, -p for pay server. #!/bin/bash USAGE="$0 [-f] [-p]" while getopts fp OPTION ; do case "$OPTION" in f) SERVER="yourispserver/rcfile" ;; p) SERVER="yourpayserver/rcfile" ;; ?) echo $USAGE; exit 1 ;; esac done ps -Af |grep slrn | grep -v "grep slrn" >/dev/null if [ $? = 1 ] ; then #If you need to export environment variable, uncomment the next #line and remove "-f $SERVER" from the line after that. #NNTPSERVER='$SERVER' && export NNTPSERVER exec slrn -f $SERVER else echo "slrn is already running!" exit 1 fi exit Todd
Re: Little OT: script to start slrn
Author: Blinky the Shark
Date: Wed, 26 Feb 2003 21:54
Date: Wed, 26 Feb 2003 21:54
12 lines
1263 bytes
1263 bytes
Rupert wrote: > My slrn complains if there's another copy running anyway. Mm? I have two instances open right now, one each for two different servers. -- Blinky Bork Browser (this is real): http://snurl.com/borkbork Screenshot Royalties: http://snurl.com/royalties
Re: Little OT: script to start slrn
Author: SINNER
Date: Wed, 26 Feb 2003 23:00
Date: Wed, 26 Feb 2003 23:00
18 lines
2036 bytes
2036 bytes
While strolling through news.software.readers, Blinky the Shark was overheard plotting: > Rupert wrote: > >> My slrn complains if there's another copy running anyway. > > Mm? I have two instances open right now, one each for two different > servers. > That didnt work 'out of the box' did it? I seem to remember reading a HOWto somewhere to get it to do that. i cant run 2 copies either, of course I have no need as I use leafnode to pull from 3 servers. -- David I WISH I HAD A KRYPTONITE CROSS, because then you could keep both Dracula and Superman away. -- Jack Handley, The New Mexican, 1988.
Re: Little OT: script to start slrn
Author: Phil Boutros
Date: Thu, 27 Feb 2003 00:22
Date: Thu, 27 Feb 2003 00:22
20 lines
1543 bytes
1543 bytes
SINNER <99nesorjd@gates_of_hell.INVALID> wrote: > > That didnt work 'out of the box' did it? I seem to remember reading a > HOWto somewhere to get it to do that. i cant run 2 copies either, of > course I have no need as I use leafnode to pull from 3 servers. It works quite well out of the box. slrn -f <a newsrc file> -h <a news server> As long as you don't use the same newsrc file for both instances, it'll work without a problem. Phil -- AH#61 Wolf#14 BS#89 bus#1 CCB#1 KOTC SENS philb@total.net http://www.total.net/~philb EKIII rides with me. http://eddiekieger.com Smacking newbies with a clue-by-four since 1998.
Re: Little OT: script to start slrn
Author: Blinky the Shark
Date: Thu, 27 Feb 2003 01:34
Date: Thu, 27 Feb 2003 01:34
21 lines
1760 bytes
1760 bytes
SINNER wrote: > While strolling through news.software.readers, Blinky the Shark was overheard plotting: >> Rupert wrote: >>> My slrn complains if there's another copy running anyway. >> Mm? I have two instances open right now, one each for two different >> servers. > That didnt work 'out of the box' did it? I seem to remember reading a > HOWto somewhere to get it to do that. i cant run 2 copies either, of > course I have no need as I use leafnode to pull from 3 servers. I don't remember doing anything special to make it happen. -- Blinky Bork Browser (this is real): http://snurl.com/borkbork Screenshot Royalties: http://snurl.com/royalties
Re: Little OT: script to start slrn
Author: DjB
Date: Thu, 27 Feb 2003 01:56
Date: Thu, 27 Feb 2003 01:56
35 lines
1965 bytes
1965 bytes
* Don Todd <nooze@clevername.homeip.net>: > In article <slrnb5pdt1.2at.dick@dbhome.bolderman.xs4all.nl>, DjB wrote: > How about this? Haven't tested it, so big disclaimer. Call the script. > -f switch for free server, -p for pay server. > > #!/bin/bash > USAGE="$0 [-f] [-p]" > while getopts fp OPTION ; > do > case "$OPTION" in > f) SERVER="yourispserver/rcfile" ;; > p) SERVER="yourpayserver/rcfile" ;; > ?) echo $USAGE; exit 1 ;; > esac > done > ps -Af |grep slrn | grep -v "grep slrn" >/dev/null > if [ $? = 1 ] ; then > #If you need to export environment variable, uncomment the next > #line and remove "-f $SERVER" from the line after that. > #NNTPSERVER='$SERVER' && export NNTPSERVER > exec slrn -f $SERVER > else > echo "slrn is already running!" > exit 1 > fi > exit Thanks todd ! But: it responds that slrn is already running when it certainly isn't... -- DjB (remove nospam.please. to reply)
Re: Little OT: script to start slrn
Author: DjB
Date: Thu, 27 Feb 2003 02:08
Date: Thu, 27 Feb 2003 02:08
26 lines
1895 bytes
1895 bytes
* Dave <duffstuff@hotmail.com>: > On Wed, 26 Feb 2003 13:50:10 GMT, SINNER wrote: > >> 2) use leafnode to grab groups and articles from all servers in one >> place so you can read everything in one copy of slrn. Leafnode is a >> local newsserver in the event you hadn't heard of it. >> > 1. Set up Slrnpull following the guide found at... > > http://infotrope.net/opensource/doc/slrnpull-multiserver > <SNIP> These 2 methods also seem like a good idea... I'm setting up a new qmail server anyway, so why not run an nntp server as well... Do leafnode and slrnpull work the same way ? Or are there any big differences ? Thanks so far guys, this stuff will keep me busy for a while :) -- DjB (remove nospam.please. to reply)
Re: Little OT: script to start slrn
Author: SINNER
Date: Thu, 27 Feb 2003 02:10
Date: Thu, 27 Feb 2003 02:10
21 lines
2171 bytes
2171 bytes
While strolling through news.software.readers, Phil Boutros was overheard plotting: > SINNER <99nesorjd@gates_of_hell.INVALID> wrote: >> >> That didnt work 'out of the box' did it? I seem to remember reading a >> HOWto somewhere to get it to do that. i cant run 2 copies either, of >> course I have no need as I use leafnode to pull from 3 servers. > > It works quite well out of the box. > > slrn -f <a newsrc file> -h <a news server> > > As long as you don't use the same newsrc file for both > instances, it'll work without a problem. Ahh, That is rather obvious too, silly me. -- David Kissing don't last, cookery do. -- George Meredith
Re: Little OT: script to start slrn
Author: SINNER
Date: Thu, 27 Feb 2003 02:30
Date: Thu, 27 Feb 2003 02:30
32 lines
2618 bytes
2618 bytes
While strolling through news.software.readers, DjB was overheard plotting: > * Dave <duffstuff@hotmail.com>: >> On Wed, 26 Feb 2003 13:50:10 GMT, SINNER wrote: >> >>> 2) use leafnode to grab groups and articles from all servers in one >>> place so you can read everything in one copy of slrn. Leafnode is a >>> local newsserver in the event you hadn't heard of it. >>> >> 1. Set up Slrnpull following the guide found at... >> >> http://infotrope.net/opensource/doc/slrnpull-multiserver >> > ><SNIP> > > These 2 methods also seem like a good idea... I'm setting up a new qmail > server anyway, so why not run an nntp server as well... > > Do leafnode and slrnpull work the same way ? Or are there any big > differences ? > > Thanks so far guys, this stuff will keep me busy for a while :) > Dont know about slrnpull, but I do know that the next version of slrn will have the whole deal built in so it can be used as an offline reader. -- David It's hard to argue that God hated Oklahoma. If He didn't, why is it so close to Texas?
Re: Little OT: script to start slrn
Author: Don Todd
Date: Thu, 27 Feb 2003 02:41
Date: Thu, 27 Feb 2003 02:41
44 lines
2599 bytes
2599 bytes
On 27 Feb 2003 01:56:55 GMT DjB <dick@nospam.please.bolderman.xs4all.nl> wrote: > * Don Todd <nooze@clevername.homeip.net>: > > In article <slrnb5pdt1.2at.dick@dbhome.bolderman.xs4all.nl>, DjB > > wrote: > > > How about this? Haven't tested it, so big disclaimer. Call the script. > > -f switch for free server, -p for pay server. > > > > #!/bin/bash > > USAGE="$0 [-f] [-p]" > > while getopts fp OPTION ; > > do > > case "$OPTION" in > > f) SERVER="yourispserver/rcfile" ;; > > p) SERVER="yourpayserver/rcfile" ;; > > ?) echo $USAGE; exit 1 ;; > > esac > > done > > ps -Af |grep slrn | grep -v "grep slrn" >/dev/null > > if [ $? = 1 ] ; then > > #If you need to export environment variable, uncomment the next > > #line and remove "-f $SERVER" from the line after that. > > #NNTPSERVER='$SERVER' && export NNTPSERVER > > exec slrn -f $SERVER > > else > > echo "slrn is already running!" > > exit 1 > > fi > > exit > > Thanks todd ! But: it responds that slrn is already running when it > certainly isn't... What did you name the script? If it contains slrn in the name, that would explain it. On my system, ps -Af | grep slrn | grep -v "grep slrn" returns 0 when slrn is running, 1 when it is not. Todd
Re: Little OT: script to start slrn
Author: Wolfgang Schelongowski
Date: Thu, 27 Feb 2003 18:19
Date: Thu, 27 Feb 2003 18:19
18 lines
1621 bytes
1621 bytes
In <20030226213924.54add4e7.nooze@clevername.homeip.net> Don Todd <nooze@clevername.homeip.net> writes: >What did you name the script? If it contains slrn in the name, that would >explain it. On my system, >ps -Af | grep slrn | grep -v "grep slrn" >returns 0 when slrn is running, 1 when it is not. And what if slrnpull is running? Better try this: ps -A | grep -q '[s]lrn$' It will catch all processes where the command ends with 'slrn'. And it won't catch itself. -- "Some people are heroes. And some people jot down notes." -- Terry Pratchett, The Truth
Re: Little OT: script to start slrn
Author: Joerg Klemenz
Date: Thu, 27 Feb 2003 18:47
Date: Thu, 27 Feb 2003 18:47
27 lines
1821 bytes
1821 bytes
* DjB wrote:
> * Markku Lehtola <markku@markkulehtola_NOSPAM.net>:
>> In article <slrnb5pdt1.2at.dick@dbhome.bolderman.xs4all.nl>, 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...
Put this in your .profile:
slrn(){ksh -c 'select i in foo bar;do slrn -h news.$i.com;break;done'}
> Well, I could create 2 scripts, but one is nicer :) And depending on
> which location I am, I also want to be able to include color/mono
> options, and so on. So if I have an example of how to make such script,
> I can easy extend it mself.
Include something like
#if$TERM xterm*
...
#endif
in your .slrnrc
joerg
Re: Little OT: script to start slrn
Author: 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.
Re: Little OT: script to start slrn
Author: Blinky the Shark
Date: Fri, 28 Feb 2003 00:44
Date: Fri, 28 Feb 2003 00:44
17 lines
1438 bytes
1438 bytes
J.B. Nicholson-Owens wrote: > DjB wrote: >> 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. Yes and no. I'm running three instances of slrn, as I write. -- Blinky Ghandi on Linux: "First they ignore you. Then they laugh at you. Then they fight you. Then you win".
Re: Little OT: script to start slrn
Author: Joerg Klemenz
Date: Fri, 28 Feb 2003 17:07
Date: Fri, 28 Feb 2003 17:07
35 lines
1844 bytes
1844 bytes
* Don Todd wrote:
> DjB <dick@nospam.please.bolderman.xs4all.nl> wrote:
Put in your .profile
slrn() {(
unset a
while test $1
do
case $1 in
foo) a="$a -h news.foo.net " ;;
cis) a="$a -h news.cis.dfn.de " ;;
*) a="$a $1 "
esac
shift
done
command slrn `echo $a`
)}
This shell function adds any number of user defined arguments to slrn
(or any other program).
>> Thanks todd ! But: it responds that slrn is already running when it
>> certainly isn't...
>
> What did you name the script? If it contains slrn in the name, that would
> explain it. On my system,
> [..]
That "locking" is totally useless. slrn already has locking.
joerg
Re: Little OT: script to start slrn
Author: HoboSong
Date: Sat, 01 Mar 2003 03:00
Date: Sat, 01 Mar 2003 03:00
62 lines
3025 bytes
3025 bytes
begin quoting Don Todd
> On 27 Feb 2003 01:56:55 GMT
> DjB <dick@nospam.please.bolderman.xs4all.nl> wrote:
>
>> * Don Todd <nooze@clevername.homeip.net>:
>> > In article <slrnb5pdt1.2at.dick@dbhome.bolderman.xs4all.nl>, DjB
>> > wrote:
>>
>> > How about this? Haven't tested it, so big disclaimer. Call the script.
>> > -f switch for free server, -p for pay server.
>> >
>> > #!/bin/bash
>> > USAGE="$0 [-f] [-p]"
>> > while getopts fp OPTION ;
>> > do
>> > case "$OPTION" in
>> > f) SERVER="yourispserver/rcfile" ;;
>> > p) SERVER="yourpayserver/rcfile" ;;
>> > ?) echo $USAGE; exit 1 ;;
>> > esac
>> > done
>> > ps -Af |grep slrn | grep -v "grep slrn" >/dev/null
>> > if [ $? = 1 ] ; then
>> > #If you need to export environment variable, uncomment the next
>> > #line and remove "-f $SERVER" from the line after that.
>> > #NNTPSERVER='$SERVER' && export NNTPSERVER
>> > exec slrn -f $SERVER
>> > else
>> > echo "slrn is already running!"
>> > exit 1
>> > fi
>> > exit
>>
>> Thanks todd ! But: it responds that slrn is already running when it
>> certainly isn't...
>
> What did you name the script? If it contains slrn in the name, that would
> explain it. On my system,
>
> ps -Af | grep slrn | grep -v "grep slrn"
>
> returns 0 when slrn is running, 1 when it is not.
>
> Todd
Try:
if ps -ef | grep [s]lrn >/dev/null
then
echo "slrn is already running"
else
slrn
fi
--
-----------------------------------------------------------------------------
Chris van Ophuijsen RLU #195880
usenet@gnubin.com
put "HoboSong" in the subject
-----------------------------------------------------------------------------
Re: Little OT: script to start slrn
Author: HoboSong
Date: Sat, 01 Mar 2003 03:00
Date: Sat, 01 Mar 2003 03:00
34 lines
2473 bytes
2473 bytes
begin quoting Wolfgang Schelongowski > In <20030226213924.54add4e7.nooze@clevername.homeip.net> > Don Todd <nooze@clevername.homeip.net> writes: > >>What did you name the script? If it contains slrn in the name, that would >>explain it. On my system, > >>ps -Af | grep slrn | grep -v "grep slrn" > >>returns 0 when slrn is running, 1 when it is not. > > And what if slrnpull is running? Better try this: > ps -A | grep -q '[s]lrn$' > It will catch all processes where the command ends with 'slrn'. > And it won't catch itself. Not on my system. (chris@alice)-(chris)$ ps -A | grep -q '[s]lrn$' (chris@alice)-(chris)$ But this one works.... (chris@alice)-(chris)$ ps -ef | grep [s]lrn chris 2293 1346 0 18:04 pts/3 00:00:05 slrn -f .jnewsrc -- ----------------------------------------------------------------------------- Chris van Ophuijsen RLU #195880 usenet@gnubin.com put "HoboSong" in the subject -----------------------------------------------------------------------------
Re: Little OT: script to start slrn
Author: J.B. Nicholson-Owens
Date: Sat, 01 Mar 2003 21:59
Date: Sat, 01 Mar 2003 21:59
15 lines
1770 bytes
1770 bytes
Blinky the Shark wrote: > Yes and no. I'm running three instances of slrn, as I write. Perhaps we're not talking about the same thing: trying to run multiple slrn instances all accessing the same newsrc. With an unchanged slrn the first slrn would lock the newsrc so other slrn instances will not modify it. The other slrn instances would see the active lock, issue an error, and refuse to run. This is why users need not construct a file locking mechanism in a shell script or maintain some other running state to keep slrn instances from clobbering one another's changes. If you're talking about running three slrn instances each using a different newsrc, then that's a completely different arrangement which is supported in the standard slrn program.
Re: Little OT: script to start slrn
Author: Blinky the Shark
Date: Sat, 01 Mar 2003 22:43
Date: Sat, 01 Mar 2003 22:43
20 lines
1736 bytes
1736 bytes
J.B. Nicholson-Owens wrote: > Blinky the Shark wrote: >> Yes and no. I'm running three instances of slrn, as I write. > Perhaps we're not talking about the same thing: trying to run multiple > slrn instances all accessing the same newsrc. With an unchanged slrn > the first We're not; that's why I said "yes and no". IIRC, a blanket statement was made about slrn's inability to coexist with itself. I butted in to show that that statement needed qualification, which you've provided. -- Blinky Have A Safe Trip: http://snurl.com/ubj (SWF) Ghandi on Linux: "First they ignore you. Then they laugh at you. Then they fight you. Then you win".
Re: Little OT: script to start slrn
Author: Brad
Date: Mon, 10 Mar 2003 19:55
Date: Mon, 10 Mar 2003 19:55
33 lines
2015 bytes
2015 bytes
DjB <dick@nospam.please.bolderman.xs4all.nl> wrote in news:slrnb5pdt1.2at.dick@dbhome.bolderman.xs4all.nl: > 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... > > Also, is it possible to include a check if slrn is alread > running, and display a message if this is the case ? > > Must be very simple to make, but I'm an absolute beginner > when it comes to scripting :( > > Thanks > I have two scripts that will do almost exactly what you are wanting to do. It doesn't check to see if slrn is already running, but if you attempt to connect to a server that is running in another instance slrn will scream that the .jnewsrc is in use; so why reinvent the wheel <g>. This is the link to the bash script that lets you sellect which server to use... <http://home.insightbb.com/~bmsims1/Scripts/slrnh> I do see some things I should clean up in it, but it should give you a good idea of where to start. This is a link to the sigmonster I wrote: <http://home.insightbb.com/~bmsims1/Scripts/picksig>
Re: Little OT: script to start slrn
Author: Matthew Malthouse
Date: Tue, 20 May 2003 16:20
Date: Tue, 20 May 2003 16:20
85 lines
3298 bytes
3298 bytes
On 26 Feb 2003 12:46:23 GMT DjB wrote:
} Hi,
}
} 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...
}
} Also, is it possible to include a check if slrn is alread running, and
} display a message if this is the case ?
Slrn does this for itself. Result of trying to start slrn with the same
srlnrc:
fatal error:
slrn: pid 1044 is locking the newsrc file.
} Must be very simple to make, but I'm an absolute beginner when it comes
} to scripting :(
Differenciate the servers with two .slrnrc files.
Then write script thus:
#!/bin/bash
#
# To use slrn with other servers
#
# This to use cis
#
german() {
if test -f .jnewsrc-german2
then slrn -h news.cis.dfn.de -f /home/matthew/.jnewsrc-german2
else
echo "Where's the rc file gone?"
exit 1
fi
}
#
# This to use ntl
#
matthew() {
if test -f .jnewsrc-matthew
then slrn -h news.cable.ntlworld.com -f /home/matthew/.jnewsrc-matthew
else
echo "Where's the rc file gone?"
exit 1
fi
}
#
# This to see which one to use
#
case "$1" in
german)
german
;;
matthew)
matthew
;;
*)
echo $"Usage: $0 {german|matthew}"
exit 1
esac
exit $?
the script is /home/matthew/bin/start-slrn and invoked (because that dir
is on my path "start-slrn matthew" or "start-slrn german" as required.
If you want a disection of the script start at the bottom with the case
statement. This is looking for either german or matthew or anything
else (*). Finding "german" it then calls the function german. Ditto for
matthew. Failing either print and error message and exit.
The function first checks if there is a slrnrc to use. If it finds it
invoked slrn with -h <use-this-server> and -f <use-this-slrnrc>; the
first so that the NNTPSERVER variable need not be set, or is ignored it
it is.
--
Il est important d'�tre un homme ou une femme en col�re; le
jour o� nous quitte la col�re, ou le d�sir, c'est cuit.
- Barbara
http://www.calmeilles.co.uk/
Re: Little OT: script to start slrn
Author: Stephen Chadfield
Date: Tue, 20 May 2003 20:13
Date: Tue, 20 May 2003 20:13
27 lines
1762 bytes
1762 bytes
DjB <dick@nospam.please.bolderman.xs4all.nl> wrote: > Hi, > > 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... > > Also, is it possible to include a check if slrn is alread running, and > display a message if this is the case ? > > Must be very simple to make, but I'm an absolute beginner when it comes > to scripting :( I just use aliases (from my ~/.bashrc): alias ntl='slrn -n -h text.news.ntlworld.com ' alias cis='slrn -n -h news.cis.dfn.de ' Specifying the newsrc in ~/.slrnrc: server "text.news.ntlworld.com" ".jnewsrc-ntl" server "news.cis.dfn.de" ".jnewsrc-cis" -- Stephen Chadfield http://www.chadfield.com/
Re: Little OT: script to start slrn
Author: Brad
Date: Wed, 21 May 2003 14:56
Date: Wed, 21 May 2003 14:56
5 lines
1036 bytes
1036 bytes
I have a little script named slrnh (I know real creative <g>) that I use for that. <http://home.insightbb.com/~bmsims1/Scripts/slrnh>
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