15 *) files=$subdomain ;;
18 if test -f $files,timings && read lastup charge <$files,timings
20 if [ $now -lt $[ $lastup + $interval_min ] ]; then
21 echo "wait $[ $lastup + $interval_min - $now ]"
22 echo >&2 "must wait at least $interval_min between updates"
25 charge=$[ $charge + $interval_avg - ($now - $lastup) ]
26 if [ $charge -gt $interval_mem ]; then
27 echo "wait $[ $charge - $interval_mem ]"
28 echo >&2 "must wait on average $interval_avg between updates"
31 if [ $charge -lt 0 ]; then charge=0; fi
36 if test -f $files,data
39 diff >/dev/null $files,data $files,new
43 if [ $diff = 0 ]; then echo 'unchanged'; exit 0; fi
44 if [ $diff != 1 ]; then exit 1; fi
47 echo $now $charge >$files,timings.new
48 mv -f $files,timings.new $files,timings
49 mv $files,new $files,data
51 exec /usr/share/userv/dyndns/install $zone