Forked from ChristianUlbrich/update_dns_hosteurope.sh
Created
October 15, 2013 08:33
-
-
Save Krizzzn/6988438 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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