From owner-freebsd-questions Fri Oct 24 19:00:49 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id TAA05010 for questions-outgoing; Fri, 24 Oct 1997 19:00:49 -0700 (PDT) (envelope-from owner-freebsd-questions) Received: from awfulhak.demon.co.uk (awfulhak.demon.co.uk [158.152.17.1]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id TAA05003 for ; Fri, 24 Oct 1997 19:00:44 -0700 (PDT) (envelope-from brian@awfulhak.org) Received: from gate.lan.awfulhak.org (localhost [127.0.0.1]) by awfulhak.demon.co.uk (8.8.5/8.8.5) with ESMTP id CAA27450; Sat, 25 Oct 1997 02:49:06 +0100 (BST) Message-Id: <199710250149.CAA27450@awfulhak.demon.co.uk> X-Mailer: exmh version 2.0zeta 7/24/97 To: mike@NetworX.ie cc: FreeBSD Support Subject: Re: Executing a program after iijppp activates the link In-reply-to: Your message of "Sat, 25 Oct 1997 01:39:01 -0000." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 25 Oct 1997 02:49:06 +0100 From: Brian Somers Sender: owner-freebsd-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > Hi all, > > I've just configured dial-on-demand user-mode ppp and it's excellent! > Works really well. > > I've got just one problem: the link will be going down and up > intermittently, as it's dial-on-demand and I've set an inactivity > timeout. > > Whenever the links becomes active again, I need to run an external > program. The "Pedantic PPP Primer" (http://www.freebsd.org/tutorials/ > ppp/ppp.html) and the manpage (ppp(1)) don't say how to do this. > > Looking at /etc/ppp/ppp.linkup.sample, the "pmdemand" entry has a > statement as follows: > ! sh -c "/some/program/or/other &" > This presumably executes the program in quotes (as the comments in the > file say it does). > > Now, what I'd really like to know is > (a) What are the exact syntax/symantics of this statement? if there are no args, $SHELL is run, otherwise ppp runs the given command. Either way, ppp wait(2)s for the program to finish (suspending its ability to transfer data). > (b) How does it differ from the "shell" command available from within > ppp's prompt? That is, could I also use > shell "/some/prog" > in my ppp.linkup entry? The latest ppp docs explain this stuff in greater detail (check out http://www.Awfulhak.org/ppp.html), but you're essentially right. In fact, ``!'' and ``shell'' are *exactly* the same thing :-) Be careful though, ppp wait(2)s for the command to finish. Newer versions of ppp have the "!bg" command for executing things in the background. > Thanks in advance for any help. > > > Bye, > Mike > > --- -- Brian , , Don't _EVER_ lose your sense of humour....