[packages] ddns-scripts: use /proc/uptime as time reference, this makes it immune against time warps (#8557)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@24869 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
@ -206,7 +206,7 @@ echo $$ > /var/run/dynamic_dns/$service_id.pid
|
||||
|
||||
|
||||
#determine when the last update was
|
||||
current_time=$(date +%s)
|
||||
current_time=$(monotonic_time)
|
||||
last_update=$(( $current_time - (2*$force_interval_seconds) ))
|
||||
if [ -e "/var/run/dynamic_dns/$service_id.update" ]
|
||||
then
|
||||
@ -231,7 +231,7 @@ do
|
||||
current_ip=$(get_current_ip)
|
||||
|
||||
|
||||
current_time=$(date +%s)
|
||||
current_time=$(monotonic_time)
|
||||
time_since_update=$(($current_time - $last_update))
|
||||
|
||||
|
||||
@ -270,7 +270,7 @@ do
|
||||
verbose_echo ""
|
||||
|
||||
#save the time of the update
|
||||
current_time=$(date +%s)
|
||||
current_time=$(monotonic_time)
|
||||
last_update=$current_time
|
||||
time_since_update='0'
|
||||
registered_ip=$current_ip
|
||||
|
Reference in New Issue
Block a user