Script for updating entryDNS

I use entryDNS as the free dynamic DNS. it is completely free. the following is my script with routerOS 6.24 that tested work to auto update. I borrowed most of scripts from some other post, so there are not mine. however, the script in original post did not work in newer version of routerOS.

Variables

:local EntryDNSAuthToken "INSERT YOUR TOKEN FROM ENTRYDNS"
:local EntryDNSForceUpdate false
:local currentIP ""
:global previousIP

Script

/tool fetch url="http://myip.dnsomatic.com/" mode=http dst-path="publicip.txt"
:set currentIP [/file get "publicip.txt" contents]
/file remove "publicip.txt"

:if ([:typeof $previousIP] = "nothing") do={ :set previousIP "" }

:if ($currentIP != $previousIP) do={
:set EntryDNSForceUpdate true
:set previousIP $currentIP
}

:if ($EntryDNSForceUpdate) do={
:do {
/tool fetch url="https://entrydns.net/records/modify/$EntryDNSAuthToken" mode=https keep-result=no
} on-error={
:log error ("EntryDNS: Failed Updating")
}
}