DDNS脚本自动绑定到默认路由的接口更新IP
:global ddnsuser "用户名"
:global ddnspass "密码"
:global ddnshost "域名"
:global gate [/ip route get [/ip route find static=yes active=yes dynamic=yes distance=1] gateway]
:global ddnsinterface {:put [/ip add get [find network=$gate] interface]}
:global ddnsip [ /ip address get [/ip address find interface=$ddnsinterface] address ]
/tool dns-update name=$ddnshost address=[:pick $ddnsip 0 [:find $ddnsip "/"] ] key-name=$ddnsuser key=$ddnspass