From owner-freebsd-questions@FreeBSD.ORG Fri Feb 13 12:30:31 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7236716A4CE for ; Fri, 13 Feb 2004 12:30:31 -0800 (PST) Received: from mta9.adelphia.net (mta9.adelphia.net [68.168.78.199]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3166C43D31 for ; Fri, 13 Feb 2004 12:30:31 -0800 (PST) (envelope-from Barbish3@adelphia.net) Received: from barbish ([67.20.101.119]) by mta9.adelphia.net (InterMail vM.5.01.06.05 201-253-122-130-105-20030824) with SMTP id <20040213203020.QTBZ25917.mta9.adelphia.net@barbish>; Fri, 13 Feb 2004 15:30:20 -0500 From: "JJB" To: "Lowell Gilbert" Date: Fri, 13 Feb 2004 15:30:29 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 In-Reply-To: <44vfmapyue.fsf@be-well.ilk.org> Importance: Normal cc: Ceri Davies cc: "freebsd-questions@FreeBSD. ORG" Subject: RE: Using dhclient to update zoneedit with my dynamic IP address X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Barbish3@adelphia.net List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2004 20:30:31 -0000 Thanks for this sample, but it exceeds my script coding ability. I added some comments to your sample but I may be lost. #!/bin/sh updater_prog = /usr/local/bin/noip2 # program to run if [ x$reason = xREBOOT ] || \ # is this an reboot or [ x$old_ip_address = x ] || \ # old ip field empty or [ x$old_ip_address != x$new_ip_address ]; then # old not EQ new then if [ -x $updater_prog ]; then # don't know what this does ${updater_prog} -i "$new_ip_address" # exec program fi fi For my purposes I think this is what I need. This way zoneedit is only updated when ip changes. Do I have script correct? /etc/dhclient-exit-hooks.sh with this content #!/bin/sh # This script only gets called when dhclient runs # (IE: boot and lease expire) # Old and new ip address fields are populated by dhclient, # which keeps the old used IP address in some config file # so it's not lost on reboot and can be read in at boot time to # determine if the ip has changed. So with cable or dsl modem # that stays powered on while PC is powered off still is # using old IP address. updater_prog = /usr/local/bin/wget....rest of command # my wget pgm if [ x$old_ip_address != x$new_ip_address ]; # old not EQ new then ${updater_prog} # exec my pgm fi -----Original Message----- From: owner-freebsd-questions@freebsd.org [mailto:owner-freebsd-questions@freebsd.org]On Behalf Of Lowell Gilbert Sent: Friday, February 13, 2004 2:24 PM To: Barbish3@adelphia.net Cc: Ceri Davies; freebsd-questions@FreeBSD. ORG Subject: Re: Using dhclient to update zoneedit with my dynamic IP address "JJB" writes: > Thanks for the pointer to the 'man dhclient-script'. > > I read through it 3-5 times and the best I can make out of what > it says is, that if I create an file like this > /etc/dhclient-exit-hooks.sh with this content > > #! /bin/sh > wget -O - --http-user=username --http-passwd=password, > 'http://dynamic.zoneedit.com/auth/dynamic.html?host=www.mydomain.com > ' > > Then every time dhclient runs (IE: at bootup and lease expire) > the dhclient-exit-hooks.sh gets run. Yes. As another example, my own script for a similar purpose: