Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Oct 1997 02:49:06 +0100
From:      Brian Somers <brian@awfulhak.org>
To:        mike@NetworX.ie
Cc:        FreeBSD Support <questions@FreeBSD.ORG>
Subject:   Re: Executing a program after iijppp activates the link 
Message-ID:  <199710250149.CAA27450@awfulhak.demon.co.uk>
In-Reply-To: Your message of "Sat, 25 Oct 1997 01:39:01 -0000." <ECS9710250101A@NetworX.ie> 

next in thread | previous in thread | raw e-mail | index | archive | help
> 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
> <mike@NetworX.ie>
> ---

-- 
Brian <brian@Awfulhak.org>, <brian@FreeBSD.org>, <bri@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?199710250149.CAA27450>