:local ednsuser "lpwuser"
:local ednspass "lpwpasswd"
:local ednshost "lpw.f3322.org"
:local ednsinterface "pppoe-out1"
:local members "http://members.3322.org/dyndns/update?system=dyndns"
#:local members "http://members./nic/update?"
:local status
:local status [/interface get [/interface findname=$ednsinterface] running]
:if ($status!=false) do={
:local ednslastip [:resolve $ednshost]
:if ([ :typeof $ednslastip ] = nil ) do={ :local ednslastip "0"}
:local ednsiph [ /ip address get [/ip address findinterface=$ednsinterface ] address ]
:local ednsip [:pick $ednsiph 0 [:find $ednsiph "/"]]
:local ednsstr "&hostname=$ednshost&myip=$ednsip"
:if ($ednslastip != $ednsip) do={
/tool fetch url=($members . $ednsstr) mode=http user=$ednsuserpassword=$ednspass dst-path=$ednshost
:delay 2
:local result [/file get $ednshost contents]
:log info ($ednshost . " " .$result)
/file remove $ednshost ;
}
}
#原文件来自http://hi.baidu.com/lpwok/item/70afab1eb90705e05f53b106