#!/bin/sh
#
# run
# Updatedd by Philipp Benner
#          http://updatedd.philipp-benner.de
#
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"
MAX_RETRY=10                    ## number of retries on connection problems

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
while [ $? == 1 ]; do
                                                                                                                             
        if [ $MAX_RETRY == 0 ]; then
            exit 0;
        fi
        let "MAX_RETRY--";
        $UPDATEDD $FLAGS
done

exit 0
