From owner-freebsd-questions Tue Apr 2 8:59:45 2002 Delivered-To: freebsd-questions@freebsd.org Received: from tninet.se (lennier.tninet.se [195.100.94.105]) by hub.freebsd.org (Postfix) with ESMTP id 5D37C37B417 for <freebsd-questions@FreeBSD.ORG>; Tue, 2 Apr 2002 08:59:34 -0800 (PST) Received: from cs.umu.se (h16n1c1o1023.bredband.skanova.com [213.64.164.16]) by lennier.tninet.se (BMR ErlangTM/OTP 3.0) with ESMTP id 480545.766769.1017.1s17918894lennier ; Tue, 02 Apr 2002 18:59:29 +0200 Message-ID: <3CA9E371.8ACA287F@cs.umu.se> Date: Tue, 02 Apr 2002 18:59:29 +0200 From: Paul Everlund <tdv94ped@cs.umu.se> X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: sv,en MIME-Version: 1.0 To: Kathy Quinlan <katinka@magestower.com> Cc: freebsd-questions@FreeBSD.ORG Subject: Re: ddclient and Dynamic DNS servers References: <EGEAIMMIBHIBOPAMFLLBAEDOCHAA.katinka@magestower.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: <freebsd-questions.FreeBSD.ORG> List-Archive: <http://docs.freebsd.org/mail/> (Web Archive) List-Help: <mailto:majordomo@FreeBSD.ORG?subject=help> (List Instructions) List-Subscribe: <mailto:majordomo@FreeBSD.ORG?subject=subscribe%20freebsd-questions> List-Unsubscribe: <mailto:majordomo@FreeBSD.ORG?subject=unsubscribe%20freebsd-questions> X-Loop: FreeBSD.ORG Kathy Quinlan wrote: > > I am trying to get ddclient to work. > > the client works when run from the command line. > > I use PPPoE for my ADSL link. What I would like to do is to get the client > to run when PPPoE gets a link up (as my IP would have changed). It has a > sample up.ip file, it is called I assume from ppp.linkup after it > establishes a link ? > > Any Ideas ?? as I am at a loss, MAN PPPoE is not to helpful :o( Might not be exactly what you want but I'll give an explanation of how I've setup my own ddup. Maybe you can use the info, maybe not. The directory /usr/local/etc/rc.d contains startup/stop-scripts for your local services. I wrote the following text file (see below), which I did name ddup.sh, and put it in that directory. As it's not very advanced you should be able to change it to meet your own needs. :-) /usr/local/etc/rc.d/ddup.sh --- #!/bin/sh case "$1" in start) echo -n ' ddup' /usr/local/sbin/ddup --host your.domain.net --wildcard > /dev/null ;; stop) ;; *) echo "" echo "Usage: `basename $0` { start | stop }" echo "" exit 64 ;; esac --- This script, as the others in the directory, is called after my PPPoE connection has been established after a startup, and my dynamic dns is updated. I haven't done anything exceptional in my ppp.conf for this to happen. My ppp.conf just establish the connection in the easiest possible way. My dynamic dns is quite static after my connection it is established, so I don't check for updates of tun0. But if yours not, and you have to update your dyn dns from time to time, there's a script called ddupcron.sh in the directory /usr/local/sbin. The ddupcron.sh creates a file containing your IP, and then compares this to the tun0 at given intervals. The intervals for this check is entered in the crontab. If I make a crontab -e (as root) I get the following: 0,10,20,30,40,50 * * * * /usr/local/sbin/ddupcron.sh \ your.domain.net tun0 > /dev/null This says it checks the file created by ddupcron.sh every tenth minute, and updates it if necessary. I've myself commented it out as I made some- thing wrong that got me banned a week from my dyn dns service, so be careful. :-) My ddupcron.sh looks like this, as I made some changes, so it doesn't send an email every time it don't do an update, and I did also add the wildcard. This file you don't have to copy from this mail, as you should have it, but I've included it here as an example: /usr/local/sbin/dupcron.sh --- #!/bin/sh # Define the host to be updated as 1st arguement to script if [ -z $1 ]; then echo "Usage: ddupcron.sh hostname [interface]" exit else HOST=$1 fi # Define interface to grep address from if [ -z $2 ]; then IFACE=fxp0 else IFACE=$2 fi IFCHECK=$(/sbin/ifconfig $IFACE|grep ask|awk '{print $2}'|cut -d ':' -f2) # Define where we should store last IP IPFILE="/var/tmp/ddupip" IPCHECK=$(cat $IPFILE) # Define path to ddup and ddup arguments (except --host) DDUP_PATH="/usr/local/sbin/ddup" #DDUP_ARGS="--debug" DDUP_ARGS="--wildcard" if [ "$IFCHECK" != "$IPCHECK" ]; then <--- changed from == to != # echo "looks like we are still the same ip" #else $DDUP_PATH --host $HOST $DDUP_ARGS echo "$IFCHECK" > $IPFILE fi --- I hope this helped you in some way. > Regards, > > Kat. Best regards, Paul To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message