Code: Select all
script,error router atl: script error: action timed out - try again, if error continues contact MikroTik support and send a supout file (13)
Code: Select all
:local maticuser "user"
:local maticpass "pass"
:local matichost "host"
:local currentIPFile disk1/dnsomatic-current-ipv4.txt
:local logFile disk1/dnsomatic-log.txt
:global dnsomaticPreviousIP
:log info "DNSoMatic: fetching current IP"
:do {
/tool fetch url="http://myip.dnsomatic.com/" mode=http dst-path=$currentIPFile
} on-error={ :local error "DNSoMatic: failed to get IP"; :log error $error; :error $error }
:local currentIP [/file get $currentIPFile contents]
:if ($currentIP != $dnsomaticPreviousIP) do={
:log info "DNSoMatic: new=$currentIP, old=$dnsomaticPreviousIP, trying update"
:do {
/tool fetch url="http://updates.dnsomatic.com/nic/update\3Fmyip=$currentIP&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG&hostname=$matichost" user=$maticuser password=$maticpass mode=http dst-path=$logFile
} on-error={ :local error "DNSoMatic: failed to update"; :log error $error; :error $error }
:log info ("DNSoMatic: response: " . [/file get $logFile contents])
:log info "DNSoMatic: new=$currentIP, old=$dnsomaticPreviousIP"
:set dnsomaticPreviousIP $currentIP
} else={
:log info "DNSoMatic: no change"
}
It always times out at the fetch line, it does log this right before:
Code: Select all
:log info "DNSoMatic: new=$currentIP, old=$dnsomaticPreviousIP, trying update"
Any ideas on how to make this script work on startup with erroring?