From owner-freebsd-questions@FreeBSD.ORG Wed Jun 6 13:50:12 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8980C106566C for ; Wed, 6 Jun 2012 13:50:12 +0000 (UTC) (envelope-from bonomi@mail.r-bonomi.com) Received: from mail.r-bonomi.com (mx-out.r-bonomi.com [204.87.227.120]) by mx1.freebsd.org (Postfix) with ESMTP id 44B9E8FC08 for ; Wed, 6 Jun 2012 13:50:11 +0000 (UTC) Received: (from bonomi@localhost) by mail.r-bonomi.com (8.14.4/rdb1) id q56DobvN029750 for freebsd-questions@freebsd.org; Wed, 6 Jun 2012 08:50:37 -0500 (CDT) Date: Wed, 6 Jun 2012 08:50:37 -0500 (CDT) From: Robert Bonomi Message-Id: <201206061350.q56DobvN029750@mail.r-bonomi.com> To: freebsd-questions@freebsd.org In-Reply-To: <1338973608.78319.YahooMailNeo@web162906.mail.bf1.yahoo.com> Subject: Re: IP -> e-mail X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 13:50:12 -0000 m > From owner-freebsd-questions@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?= > To: "freebsd-questions@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. Have it: 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