IP -> e-mail
bonomi at mail.r-bonomi.com
Wed Jun 6 13:50:12 UTC 2012
> From owner-freebsd-questions at freebsd.org Wed Jun 6 07:37:57 2012
> Date: Wed, 6 Jun 2012 02:06:48 -0700 (PDT)
> From: =?iso-8859-1?Q?D=E1nielisz_L=E1szl=F3?= <laszlo_danielisz at yahoo.com>
> To: "freebsd-questions at freebsd.org" <freebsd-questions at freebsd.org>
> Subject: IP -> e-mail
> Hi everybody,
> Let say my computer is connected to the internet with a cable modem and h
> as a dynamic IP address via DHCP. This address is refreshed after every r
> andom days.
> I want to know the new address even when I'm not home. Like send an e-mai
> l with the new IP, I already know how to do this, but how can I track the
> event when my computer receives the new IP?
> Any ideas or same issues?
Schedule a 'cron' job to run as frequently as you like.
a) do an 'ifconfig -a', or maybe just check the 'interface of interest'.
b) 'diff' that output against a 'reference' copy from the previous run
c) send an email if diff reports differences
d) save the ifconfig output for referene in the next run
More information about the freebsd-questions