Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Sep 1998 17:38:52 +0100
From:      Brian Somers <brian@Awfulhak.org>
To:        "Frank Griffith" <frankg@idfw.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: ppp.linkup file won't execute command 
Message-ID:  <199809211638.RAA18497@woof.lan.awfulhak.org>
In-Reply-To: Your message of "Sun, 20 Sep 1998 19:53:11 CDT." <012c01bde4fa$36069580$0200a8c0@fast1.dfw.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> I run FreeBSD 2.2.7 on a Pentium system. I use ppp to
> hook-up dynamically to my ISP and run Apache 1.3.1.
> 
> I want to have my system e-mail my dynamically assigned
> IP number each time I hook-up. So following some much
> needed advice, I added this line to the MYADDR section
> of my /etc/ppp/ppp.linkup file:
> 
> !bg ifconfig tun0 | mail -s "My Latest IP Address" me@my_domain.com

Ppp doesn't do anything special with ``|''.  You'll need

  !bg sh -c "ifconfig tun0 | mail -s "My latest IP address" me@my_domain.com

But, I wouldn't do that !  Do this instead:

  !bg mail -s "Address (on INTERFACE) is MYADDR" me@my_domain.com

Make sure you've got the latest ppp (within the last few weeks) 
as older versions won't expand MYADDR and INTERFACE if they're inside 
quotes.  You can get the latest version via

  http://www.Awfulhak.org/ppp.html

> Unfortunately, this does not work. So I made a script which
> does the same thing and revised the above line to call
> the script instead. But still no go. Can anyone offer some
> advice on this?

I'll bet you forgot ``#! /bin/sh'' (or whatever) at the top of your 
script.  Ppp exec()s the command and exec() will fail without this.
-- 
Brian <brian@Awfulhak.org>, <brian@FreeBSD.org>, <brian@OpenBSD.org>
      <http://www.Awfulhak.org>;
Don't _EVER_ lose your sense of humour....



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



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