Article View: news.software.readers
Article #121004Re: Little OT: script to start slrn
From: 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
-----------------------------------------------------------------------------
Technical Details
Message-ID:
<8b7p3b.f09.ln@192.168.1.75>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!nntp.cs.ubc.ca!cyclone.bc.net!sjc70.webusenet.com!sjc72.webusenet.com!news.webusenet.com!newsfeed1.easynews.com!easynews.com!easynews!easynews-local!post-03.news.easynews.com.POSTED!192.168.1.75!nobodyReferences:
<slrnb5pdt1.2at.dick@dbhome.bolderman.xs4all.nl> <slrnb5pk2j.ev2.nooze@clevername.homeip.net> <slrnb5qs7d.2s9.dick@dbhome.bolderman.xs4all.nl> <20030226213924.54add4e7.nooze@clevername.homeip.net>Show Full Headers
Complete Article Headers
Message-ID: <8b7p3b.f09.ln@192.168.1.75> Subject: Re: Little OT: script to start slrn Date: Sat, 01 Mar 2003 03:00:13 GMT From: HoboSong <usenet@gnubin.com> References: <slrnb5pdt1.2at.dick@dbhome.bolderman.xs4all.nl> <slrnb5pk2j.ev2.nooze@clevername.homeip.net> <slrnb5qs7d.2s9.dick@dbhome.bolderman.xs4all.nl> <20030226213924.54add4e7.nooze@clevername.homeip.net> 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!nntp.cs.ubc.ca!cyclone.bc.net!sjc70.webusenet.com!sjc72.webusenet.com!news.webusenet.com!newsfeed1.easynews.com!easynews.com!easynews!easynews-local!post-03.news.easynews.com.POSTED!192.168.1.75!nobody Newsgroups: news.software.readers Reply-To: usenet@gnubin.com Best-Viewed-With: slrn User-Agent: slrn/0.9.7.4 (Linux) Lines: 61 X-Complaints-To: abuse@easynews.com Organization: EasyNews, UseNet made Easy! - Test our service with our FREE trial at https://www.easynews.com/trial/trial.phtml X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.