Ken (not verified) Das Ganze ist wesentlich Fri, 09/25/2015 - 9:30am Das Ganze ist wesentlich simpler mittels Bash-Skript zu lösen. Einfach per Cron-Job laufen lassen: #!/bin/bash # # spdns.de external ip update script # spdns host vars # Hier Host und Token eintragen: dns_host="meinserver.spdns.de" dns_token="abcd-efgh-ijkl" # define response file (derived from script file) response_file="$(readlink -f $0).response" # get external ip external_ip=`wget "http://checkip4.spdns.de" -O "-" --quiet` # send update request spdns_response=`wget --user=$dns_host --password=$dns_token "https://www.spdns.de/nic/update?hostname=$dns_host&myip=$external_ip" -O "-" --quiet` # display response [[ ! "`/usr/bin/tty`" == "not a tty" ]] && echo "" [[ ! "`/usr/bin/tty`" == "not a tty" ]] && echo "spdns update response: $spdns_response" [[ ! "`/usr/bin/tty`" == "not a tty" ]] && echo "" # save result into file echo "$spdns_response" > $response_file # done exit 0
Das Ganze ist wesentlich
Fri, 09/25/2015 - 9:30amDas Ganze ist wesentlich simpler mittels Bash-Skript zu lösen.
Einfach per Cron-Job laufen lassen:
#!/bin/bash
#
# spdns.de external ip update script
# spdns host vars
# Hier Host und Token eintragen:
dns_host="meinserver.spdns.de"
dns_token="abcd-efgh-ijkl"
# define response file (derived from script file)
response_file="$(readlink -f $0).response"
# get external ip
external_ip=`wget "http://checkip4.spdns.de" -O "-" --quiet`
# send update request
spdns_response=`wget --user=$dns_host --password=$dns_token "https://www.spdns.de/nic/update?hostname=$dns_host&myip=$external_ip" -O "-" --quiet`
# display response
[[ ! "`/usr/bin/tty`" == "not a tty" ]] && echo ""
[[ ! "`/usr/bin/tty`" == "not a tty" ]] && echo "spdns update response: $spdns_response"
[[ ! "`/usr/bin/tty`" == "not a tty" ]] && echo ""
# save result into file
echo "$spdns_response" > $response_file
# done
exit 0