From owner-freebsd-questions@FreeBSD.ORG Wed Jun 6 13:17:52 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0172B106566C for ; Wed, 6 Jun 2012 13:17:52 +0000 (UTC) (envelope-from roberthuff@rcn.com) Received: from smtp02.lnh.mail.rcn.net (smtp02.lnh.mail.rcn.net [207.172.157.102]) by mx1.freebsd.org (Postfix) with ESMTP id 21DB98FC1E for ; Wed, 6 Jun 2012 13:17:51 +0000 (UTC) Received: from mr17.lnh.mail.rcn.net ([207.172.157.37]) by smtp02.lnh.mail.rcn.net with ESMTP; 06 Jun 2012 09:17:50 -0400 Received: from smtp04.lnh.mail.rcn.net (smtp04.lnh.mail.rcn.net [207.172.157.104]) by mr17.lnh.mail.rcn.net (MOS 4.3.4-GA) with ESMTP id BNH60408; Wed, 6 Jun 2012 09:17:48 -0400 Received: from 209-6-86-84.c3-0.smr-ubr2.sbo-smr.ma.cable.rcn.com (HELO jerusalem.litteratus.org.litteratus.org) ([209.6.86.84]) by smtp04.lnh.mail.rcn.net with ESMTP; 06 Jun 2012 09:17:48 -0400 From: Robert Huff MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <20431.22651.888125.876852@jerusalem.litteratus.org> Date: Wed, 6 Jun 2012 09:17:47 -0400 To: Matthias Apitz In-Reply-To: <20120606125125.GA2043@tiny> References: <1338973608.78319.YahooMailNeo@web162906.mail.bf1.yahoo.com> <20120606125125.GA2043@tiny> X-Mailer: VM 7.17 under 21.5 (beta28) "fuki" XEmacs Lucid X-Junkmail-Whitelist: YES (by domain whitelist at mr17.lnh.mail.rcn.net) Cc: freebsd-questions@freebsd.org 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:17:52 -0000 Matthias Apitz writes: > > Let say my computer is connected to the internet with a cable > modem and has a dynamic IP address via DHCP. This address is > refreshed after every random days. > > > I want to know the new address even when I'm not home. Like > send an e-mail 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? > > Run this in a cronjob: > > lynx -dump myip.nl | fgrep 'WAN IP' > > strore the result in a file and when it changes, trigger a mail; Or, using only tools in the base system: ifconfig | head | grep "inet " | awk '{print $2}' Robert Huff