diff --git a/actions/dynamicdns b/actions/dynamicdns index 4b45a8c37..3968d744f 100755 --- a/actions/dynamicdns +++ b/actions/dynamicdns @@ -374,10 +374,10 @@ case ${cmd} in fi # if we don't know our WAN IP do a blind update once a hour if [ "${wanip}" = ${NOIP} ];then - uptime=$(cut -d . -f 1 /proc/uptime) + currenttime=$(date +%s) LAST=0 [ -f ${LASTUPDATE} ] && LAST=$(cat ${LASTUPDATE}) - diff=$((uptime - LAST)) + diff=$((currenttime - LAST)) if [ ${diff} -gt ${UPDATEMINUTESUNKNOWN} ];then doUpdate fi @@ -392,7 +392,7 @@ case ${cmd} in success) date=$(date) echo "last update done (${date})" > ${STATUSFILE} - awk '{print $1}' /proc/uptime |cut -d . -f 1 > ${LASTUPDATE} + date +%s > ${LASTUPDATE} # if called from cronjob, the current IP is given as parameter if [ $# -eq 1 ];then echo "${1}" > ${IPFILE}