Last active
January 27, 2021 22:21
-
-
Save ChristianUlbrich/6412229 to your computer and use it in GitHub Desktop.
Aktualisiert eine Subdomain bei HostEurope - auch bekannt als "poor man's dyndns". :)
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 |
Nein und ich würde so etwas auch nicht mehr machen, sondern eine "richtige" Lösung nehmen; also einen Provider, der DNS kann und dafür auch eine API hat und nicht so einen Bastelkram wie HostEurope.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hosteurope hat die Urls geändert, gibt es eine aktualisierte Variante dieser Script?
Haben Sie auch eine C# lösung für Windows Enviroment?