mikrotik script
mikrotik script
- 主页
- 后台控制中心
- Community Forum
- Services
- Dynamic DNS Service
- mikrotik script
- Community Forum
- mikrotik script
Topic: mikrotik script
Mikrotik script not work 4 me. Where I am wrong ?:global ddnsuser drdado:global ddnspass mypassword:global theinterface wan:global ddnshost drdado:global ipddns [:resolve $ddnshost];:global ipfresh [ /ip address get [/ip address find interface=$theinterface ] address ]:if ([ :typeof $ipfresh ] = nil ) do={:log info ("dynu: No ip address on $theinterface .")} else={:for i from=( [:len $ipfresh] - 1) to=0 do={:if ( [:pick $ipfresh $i] = "/") do={:set ipfresh [:pick $ipfresh 0 $i];}}:if ($ipddns != $ipfresh) do={:log info ("dynu: IP-dynu = $ipddns"):log info ("dynu: IP-Fresh = $ipfresh"):log info "dynu: Update IP needed, Sending UPDATE...!":global str "/nic/update?hostname=$ddnshost&myip=$ipfresh"/tool fetch address=api.dynu.com src-path=$str mode=http user=$ddnsuser password=$ddnspass dst-path=("/Dynu.".$ddnshost):delay 1:global str [/file find name="Dynu.$ddnshost"];/file remove $str:global ipddns $ipfresh:log info "dynu: IP updated to $ipfresh!"} else={:log info "dynu: dont need changes";}}
Reply with quote | Report
:global ddnshost drdadoThe ddnshost is not your username, it should be your hostname/domain name.
Reply with quote | Report
Author | Topic: mikrotik script |
---|---|
drdado Joined: 2015/6/8 |
mikrotik script 2019年1月30日 11:39
Mikrotik script not work 4 me. Where I am wrong ?:global ddnsuser drdado:global ddnspass mypassword:global theinterface wan:global ddnshost drdado:global ipddns [:resolve $ddnshost];:global ipfresh [ /ip address get [/ip address find interface=$theinterface ] address ]:if ([ :typeof $ipfresh ] = nil ) do={:log info ("dynu: No ip address on $theinterface .")} else={:for i from=( [:len $ipfresh] - 1) to=0 do={:if ( [:pick $ipfresh $i] = "/") do={:set ipfresh [:pick $ipfresh 0 $i];}}:if ($ipddns != $ipfresh) do={:log info ("dynu: IP-dynu = $ipddns"):log info ("dynu: IP-Fresh = $ipfresh"):log info "dynu: Update IP needed, Sending UPDATE...!":global str "/nic/update?hostname=$ddnshost&myip=$ipfresh"/tool fetch address=api.dynu.com src-path=$str mode=http user=$ddnsuser password=$ddnspass dst-path=("/Dynu.".$ddnshost):delay 1:global str [/file find name="Dynu.$ddnshost"];/file remove $str:global ipddns $ipfresh:log info "dynu: IP updated to $ipfresh!"} else={:log info "dynu: dont need changes";}}
|
armo Joined: 2017/6/23 |
mikrotik script 2019年2月11日 20:32
:global ddnshost drdadoThe ddnshost is not your username, it should be your hostname/domain name.
|
It is currently 2024年11月24日 17:17 US Mountain Standard Time
2024年11月24日 17:17