Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Krizzzn/6988438 to your computer and use it in GitHub Desktop.
Save Krizzzn/6988438 to your computer and use it in GitHub Desktop.
#!/bin/sh
#aktualisiert DNS-Einträge bei HostEurope
#HostEurope-Zugangsdaten
KUNDENNR=xxx
PASSWORD=xxx
#Host-ID des eigentlichen Eintrages
HOSTID=xxx
#externe IP bestimmen und dann vergleichen
IP=$(wget -qO- ifconfig.me/ip)
UPDATEIP=false
if [ -f /var/run/current.ip ]
then
#Vergleich, ob IP sich geändert hat, wenn ja, dann Update erzwingen
oldIP=$(cat /var/run/current.ip)
if [ $oldIP != $IP ]
then
UPDATEIP=true
fi
else
echo $IP > /var/run/current.ip
UPDATEIP=true
fi
#bei Bedarf ein Update machen
if $UPDATEIP ; then
curl -k --url "https://kis.hosteurope.de/?kdnummer=$KUNDENNR&passwd=$PASSWORD" --url "https://kis.hosteurope.de/administration/domainservices/index.php?record=A&pointer=$IP&menu=1&mode=autodns&domain=zalari.de&submode=edit&truemode=host&hostid=$HOSTID&submit=Update" -c /dev/null >/dev/null 2>1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment