From owner-freebsd-questions Thu Feb 5 18:22:22 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA24744 for questions-outgoing; Thu, 5 Feb 1998 18:22:22 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from awfulhak.org (awfulhak.demon.co.uk [158.152.17.1]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA24645 for ; Thu, 5 Feb 1998 18:21:54 -0800 (PST) (envelope-from brian@Awfulhak.org) Received: from gate.lan.awfulhak.org (localhost [127.0.0.1]) by awfulhak.org (8.8.7/8.8.7) with ESMTP id HAA06685; Thu, 5 Feb 1998 07:37:51 GMT (envelope-from brian@gate.lan.awfulhak.org) Message-Id: <199802050737.HAA06685@awfulhak.org> X-Mailer: exmh version 2.0.1 12/23/97 To: Kwoody cc: Brian Somers , freebsd-questions Subject: Re: small script question.. In-reply-to: Your message of "Wed, 04 Feb 1998 11:14:27 PST." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 05 Feb 1998 07:37:51 +0000 From: Brian Somers Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG X-To-Unsubscribe: mail to majordomo@FreeBSD.org "unsubscribe questions" > > > 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 , , Don't _EVER_ lose your sense of humour....