:local ednsuser "账号"
:local ednspass "密码"
:local ednshost "域名"
:local ednsinterface "pppoe-out1"
:local members "http://members.3322.net/dyndns/update?system=dyndns"
:local status
:local status [/interface get [/interface find name=$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 find interface=$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=$ednsuser password=$ednspass
:delay 2
:local result [/file get $ednshost contents]
:log info ($ednshost . " " .$result)
/file remove $ednshost;
}
}

添加脚本完毕后 新建定时任务

相关文章:

  • 2021-12-20
  • 2021-06-24
  • 2021-12-05
  • 2021-07-26
  • 2021-12-18
  • 2022-02-09
  • 2022-01-08
  • 2022-02-09
猜你喜欢
  • 2021-09-30
  • 2022-12-23
  • 2021-05-02
  • 2021-11-27
  • 2022-02-09
  • 2021-09-21
  • 2021-07-23
相关资源
相似解决方案