#!/bin/sh registered="0.0.0.0" max_days=10 # max number of days to go without forcing an update last_update=`date +%s` max_seconds=`expr $max_days*24*60*60` while :; do current=$(wget -O - http://checkip.dyndns.org|sed s/[^0-9.]//g) if [ $(($last_update+$max_seconds)) -lt `date +%s` ] then # set old_ip to be different, forcing an update registered="0.0.0.0" fi if [ "$current" != "$registered" ] then updatedd ovh -- --ipv4 $current user:psw public_URL registered=$current last_update=`date +%s` fi sleep 300 done