Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 05 Feb 1998 07:37:51 +0000
From:      Brian Somers <brian@Awfulhak.org>
To:        Kwoody <kwoody@citytel.net>
Cc:        Brian Somers <brian@Awfulhak.org>, freebsd-questions <freebsd-questions@FreeBSD.ORG>
Subject:   Re: small script question.. 
Message-ID:  <199802050737.HAA06685@awfulhak.org>
In-Reply-To: Your message of "Wed, 04 Feb 1998 11:14:27 PST." <Pine.BSF.3.91.980204105901.26597C-100000@mybsd.net> 

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> 
> On Wed, 4 Feb 1998, Brian Somers wrote:
> 
> > >    echo "not found"
> > >    echo "running ppp..."
> > >    ppp -auto -alias city
> > > fi
> > [.....]
> > 
> > or:
> > 
> > #! /bin/sh
> > killall -0 ppp || ppp -auto -alias city
> > 
> 
> I dont want to kill it if its already running. I just want to check if 
> ppp is running if not then run it.
> 
> Though I think I see what it does. It kills ppp and any other process's 
> it spawned. If ppp was not running at the time, killall would fail
> and then run the next statement.
> 
> But what if ppp is running? Killall would kill ppp then (now I'm guessing 
> here) since it killed it it says done killed, but then ppp will not be 
> running cause killall was successful so the next statement does not get 
> executed.
> 
> Or am I way off base here?

The signal 0 is special.  It doesn't send anything to the process - 
it just tells you if it can be delivered.


-- 
Brian <brian@Awfulhak.org>, <brian@FreeBSD.org>, <brian@OpenBSD.org>
      <http://www.Awfulhak.org>;
Don't _EVER_ lose your sense of humour....





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199802050737.HAA06685>