UnoTelly IP Address Update Script

Really you not pass any IP at UnoTelly with that script, unotelly detect automtically your IP…


Based on this:
http://forum.mikrotik.com/t/ddns-script-for-no-ip-dyndns-ipchange/79060/1

OBVIOUSLY RUN ONLY ON SCHEDULER, IF RUN ON CLI DO ERROR ON “?”

:local DDNSuser value="unotelly-user-hash";
:local DDNSpass value="";
:local DDNShost value="my.site.ext";

# possible value are DynDNS, No-IP, ChangeIP, UnoTelly;
:local DDNStype value="UnoTelly";

/tool fetch mode=http keep-result=yes url="http://myip.dnsomatic.com/index.html" dst-path="CURRip";
/delay delay-time=2s;
:local CURRip value=[:toip [/file get "CURRip" value-name=contents]];
/delay delay-time=2s;
/file remove "CURRip";

:if ([:resolve $DDNShost] != $CURRip) do={
 :if ($DDNStype = "DynDNS") do={ /tool fetch mode=http keep-result=no url="http://members.dyndns.org/nic/update?hostname=$DDNShost&myip=$CURRip" user=$DDNSuser password=$DDNSpass; };
 :if ($DDNStype = "No-IP") do={ /tool fetch mode=http keep-result=no url="http://dynupdate.no-ip.com/nic/update?hostname=$DDNShost&myip=$CURRip" user=$DDNSuser password=$DDNSpass; };
 :if ($DDNStype = "ChangeIP") do={ /tool dns-update name=$DDNShost address=$CURRip key-name=$DDNSuser key=$DDNSpass; };
 :if ($DDNStype = "UnoTelly") do={ /tool fetch mode=http keep-result=no url="http://api.unotelly.com/api/v1/network/update_by_hash_api?user_hash=$DDNSuser"; };
};