Check / Update DDNS

wget http://dl.panticz.de/endian/checkddns -O /etc/cron.d/checkddns

0 * * * *     /sbin/checkddns.sh YOUR_HOSTNAME.dyndns.org
1

wget http://dl.panticz.de/endian/checkddns.sh -O /sbin/checkddns.sh

#!/bin/bash

if [ ! -z $1 ]; then
	URL=$1
else
	echo "Hostname missing"
	echo "Usage: $0 YOUR_HOSTNAME.dyndns.org"
	exit 1
fi

IP_DNS=$(ping -c 1 YOUR_HOSTNAME.dyndns.org | head -1 | cut -d"(" -f2 | cut -d")" -f1)
IP_LOCAL=$(ifconfig | grep inet | tail -2 | head -1 | cut -d":" -f2 | cut -d" " -f1)

ping -c 1 ${URL} > /dev/null
if [ $? -gt 0 -o "${IP_DNS}" != "${IP_LOCAL}" ]; then
	echo "Update Dynamic DNS..." 
	/usr/local/bin/setddns.pl
fi
1

chmod u+x /sbin/checkddns.sh
/etc/init.d/fcron restart