Good morning,
I hope this script will be useful for someone and I want to share it
Create a new script named no-ip_update
The following permissions are required for this script to run:
write
test
read
2. Paste the source code that appears below changing as you need
Set needed variables
:local username “your_no-ip_user”
:local password “your_no-ip_pass”
Set the hostname or label of network to be updated.
:local hostname “hostname.no-ip.info”
/tool fetch mode=http address=“checkip.dyndns.it” src-path=“/” dst-path=“/dyndns.checkip.html”
:local result [/file get dyndns.checkip.html contents]
:global dyndnsForce
:global previousIP
parse the current IP result
:local resultLen [:len $result]
:local startLoc [:find $result “: " -1]
:set startLoc ($startLoc + 2)
:local endLoc [:find $result “” -1]
:local currentIP [:pick $result $startLoc $endLoc]
:log info “UpdateDynDNS: currentIP = $currentIP”;
:if (($currentIP != $previousIP) || ($dyndnsForce = true)) do={
:set dyndnsForce false
:set previousIP $currentIP
/tool fetch mode=http url=“http://$username:$password@dynupdate.no-ip.com/nic/update\3Fhostname=$hostname&myip=$currentIP” dst-path=”/noip.txt"
:local result [/file get noip.txt contents]
:log info (“UpdateDynDNS: Dyndns update needed”)
:log info ("UpdateDynDNS: Dyndns Update Result: ".$result)
:put ("Dyndns Update Result: ".$result)
} else={
:log info (“UpdateDynDNS: No dyndns update needed”)
}
3. then create a new scheduler entry to run this script every 5 mins.
/system scheduler add comment=“Update No-IP DDNS” disabled=no interval=5m
name=no-ip_update on-event=no-ip_update policy=read,write,test
Should it be posted in wiki? How?
ByeBye