#!/bin/bash wanip=$(curl https://csx.cc/ip/) # dnsip=$(gethostip -d sld.tld) dnsip=$(ping -c 1 sld.tld | grep -Eo -m 1 '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}') if [[ "$wanip" != "$dnsip" ]]; then curl "https://dynamicdns.park-your-domain.com/update?host=@&domain=sld.tld&password=apikeyhald&ip=$wanip"; fi # dnsip2=$(gethostip -d domain.de) dnsip2=$(ping -c 1 domain.de | grep -Eo -m 1 '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}') if [[ "$wanip" != "$dnsip2" ]]; then curl -v -X PUT -u alias@mail.net:geheimoderbleibda -d "{\"ip_address\":\"$wanip\"}" https://api.twodns.de/hosts/all; fi