Koozali.org: home of the SME Server

DynDNS Script "by hand"

Alexander Ziemann

DynDNS Script "by hand"
« on: April 29, 2002, 12:25:40 AM »
Hi everybody out there!

After a long time of smooth-running e-smith 5.1.2, i have a problem:

I am using a "pseudo-static" DSL-Connection, that updates external IP only, when server is rebooted. That happens about once a year :-). Also i am using DynDNS.org client - works fine.

Now i have to switch my *.de domain to a german DNS-Provider, who also supports DNS and the rest like DynDNS. I can manually put in the DNS-Records into his DNS-Server to point to my external IP. This is working :-)...

But of course I have to do automatic IP-Updates, to be shure in case of rebooting the server. For that purpose, these folks provide an ELF-Prog called "dnsupdate", which is called by a shell script called "upddns.sh"; this one looks like:

<<>>
#!/bin/sh
# (c) 2001 DNSteam.de, Udo Dluzinski
#Detect the IP-Address of a specified interface
#and start the update deamon with the parameters

#Dieses Programm könenn Sie auch automatisch von dem script /etc/ppp/ip-up aufrufen lassen

#Change this parameter with your data
USERNAME="XXXX"      #Der Benutzername unter dem Sie sich bei DNSteam registriert haben
PASSWORD="XXXX"   #Das dazugehörige Kennwort welches Sie per Email erhalten haben
DOMAIN="XXXX.de"      #Ihre rusgesuchte  Domain z.B. mp3hole.de
INTERFACE="eth1"      #Das interface welches Ihre dynamische IP    bei der einwahl erhält z.B. ppp0 oder ippp0

IFCONFIG="/sbin/ifconfig"   #Der Pfad des Programms ifconfig
GREP="/usr/bin/grep"      #Der Pfad des Programms grep
CUT="/usr/bin/cut"      #Der Pfad des Programms cut
DNSUPDATE="./dnsupdate"      #Der Pfad des Programms dnsupdate. Normaler weise das gleich verzeichnis wie upddns.sh
#Don´t change below / Hier nichts mehr editieren

IPADDRESS=$($IFCONFIG $INTERFACE | $GREP -i "inet addr" | $CUT -d":"  -f2 | $CUT -d" " -f1);
echo "Detected ip is $IPADDRESS"
echo "Update the nameserver now ..."

#Hier wird das update gestartet
$DNSUPDATE $DOMAIN $IPADDRESS $USERNAME $PASSWORD

echo "Update finished ..."

<>

Im unable

a) to start this script
b) confused, where to put it and the according ELF.prog
c) unshure, where to call it.

I tried to build a "custom" entry like described in some howto here, but it still gives errors (file not found..).

Also i want to use DynDNS built-in Client a little longer. So it would be best to call this script from maybe cron-job or rc.init only in case of reboot.

Any idea? I promise to make a howto out of this. Thanx!