diff --git a/actions/dynamicdns b/actions/dynamicdns index cf1207518..add28abb6 100755 --- a/actions/dynamicdns +++ b/actions/dynamicdns @@ -269,23 +269,26 @@ doGetWANIP() # this function is called via cronjob doUpdate() { + dnsentry=$(nslookup ${host}|tail -n2|grep A|sed s/[^0-9.]//g) + if [ "${dnsentry}" = "${wanip}" ];then + return + fi if [ ! -z ${server} ];then start-stop-daemon -S -x ${UPDATE_TOOL} -m -p ${PIDFILE} -- -c ${cfgfile} fi - if [ ! -z ${updateurl} ];then doReplaceVars if [ "${basicauth}" = "enabled" ];then - local wgetoptions=" --user $user --password $pass " + local wgetoptions=" --user ${user} --password ${pass} " fi if [ "${ignoreCertError}" = "enabled" ];then local wgetoptions=" --no-check-certificate " fi - $WGET ${wgetoptions} "${updateurl}" + ${WGET} ${wgetoptions} "${updateurl}" # ToDo: check the returning text from WEB Server. User need to give expected string. - if [ $? -eq 0 ];then - ${0} success $wanip + if [ ${?} -eq 0 ];then + ${0} success ${wanip} else ${0} failed fi