#!/bin/sh
#
# run
# Updatedd by Philipp Benner
#          http://updatedd.philipp-benner.de
#
echo "Edit this file!"		## remove these
exit 1				## two lines!
#

HOSTNAME="test.ovh.net"
LOGIN="user:password"
INTERFACE="ppp0"
SERVICE="ovh"
FLAGS="-S $SERVICE -n $HOSTNAME -i $INTERFACE -u $LOGIN -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
