Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Jul 2002 11:17:10 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        fred@timogen.com
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: which script will be executed when the adsl IP up
Message-ID:  <20020714101710.GA25158@happy-idiot-talk.infracaninophi>
In-Reply-To: <007201bfef6b$e615f100$7f05a8c0@fred>
References:  <007201bfef6b$e615f100$7f05a8c0@fred>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jul 16, 2000 at 02:21:54PM -0700, fred@timogen.com wrote:

>     I have use the adsl to connect the internet.  As the ppp link
> will be disconnect, I want the gateway the send me the new IPaddress
> to my mail box.  Could u tell me, when the ADSL link is up, which
> scripts will be executed.

>     In linux that shoud be /etc/ppp/ip-up, I donnot know what is in
> FreeBSD.

You can use the /etc/ppp/ppp.linkup and /etc/ppp/ppp.linkdown files to
cause commands to be executed when your link goes up or down.  For
instance, assuming that your ppp.conf is based on the default version,
this ppp.linkup file will e-mail root an empty message with your new
IP number in the subject line:

    #
    # Stuff to run when the PPP link comes up.
    #
    papchap:
      !bg mail -s "PPP link up IP = MYADDR" root </dev/null
    #
    # That's All Folks!
    #

The special token "MYADDR" is replaced by the new IP number.  The
ppp(8) man page has details of all such tokens in the description of
the `!bg' command in the extensive "PPP COMMAND LIST" section.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
Tel: +44 1628 476614                                  Marlow
Fax: +44 0870 0522645                                 Bucks., SL7 1TH UK

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?20020714101710.GA25158>