[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Script for IP address change



On Wed, 20 Aug 2003 08:48:05 -0700 (PDT)
William Crowshaw <wcrowshaw@yahoo.com> wrote:

> This [Q] is not debian specific, but you guys are more
> knowledgeable than normal linux user groups that I
> thought I would ask it here.  My machine's external IP
> address is configured via DHCP from my cable modem
> service provider.  Any suggestions on how to write a
> script that notifies me via e-mail when this this IP
> periodically changes?  I use dhclient to retrieve the
> IP from the DHCP server.
> 
> Many thanks,
> 
> William.

You can hook arbitrary commands to be performed when an interface comes
up (or down, or both) by adding lines to /etc/network/interfaces.  Check
out the interfaces man page for examples.  You could also create a
dhclient-exit-hooks script in /etc/dhcp3.  That's a bit more consistent
across distros, but less flexible since it will apply to any interface
configured via DHCP.

-- 
Todd Pytel

----------------------------------------
Signature attached
PGP Key ID 77B1C00C

Attachment: pgp5c8pQDwKRC.pgp
Description: PGP signature


Reply to: