#!/bin/sh
#
# run
# Updatedd by Philipp Benner
#          http://philippb.tk
#
echo "Edit this file!"		## remove these
exit 1				## two lines!
#

HOSTNAMES="test.dyndns.org,test.gotdns.org"
LOGIN="user:password"
SYSTEM="dyndns"			# (custom, statdns, dyndns)
SERVICE="dyndns"
FLAGS="-S $SERVICE -n $HOSTNAMES -u $LOGIN -s $SYSTEM -y"

MYPATH="/bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin"
for dir in $MYPATH; do
	if [ -x $dir/updatedd ]; then
		UPDATEDD=$dir/updatedd
	fi
done

if [ -z $UPDATEDD ]; then
	echo "updatedd seems not to be installed"
fi

$UPDATEDD $FLAGS
var=$?
while [ "$var" != 0 ]; do
	sleep 10
	$UPDATEDD $FLAGS
	var=$?
done

exit 0
