In parole povere gestisce automaticamente l'account dyndns senza l'ausilio di un software e di un server.
- Come procedere:
-Tramite linea di comandi in "New terminal" inserite il seguente codice (Molto piu semplicemente facendo copia e incolla su winbox system>script>aggiungi "+")
system script add=dyndns-update source=# Set needed variables
:local username "dyndnsUsername"
:local password "dyndnsPassword"
:local hostname "hostname.dyndns.org"
:global dyndnsForce
:global previousIP
# print some debug info
:log info ("dyndns-update: username = $username")
:log info ("dyndns-update: password = $password")
:log info ("dyndns-update: hostname = $hostname")
:log info ("dyndns-update: previousIP = $previousIP")
# get the current IP address from the internet (in case of double-nat)
/tool fetch mode=http address="checkip.dyndns.org" src-path="/" dst-path="/dyndns.checkip.html"
:local result [/file get dyndns.checkip.html contents]
# parse the current IP result
:local resultLen [:len $result]
:local startLoc [:find $result ": " -1]
:set startLoc ($startLoc + 2)
:local endLoc [:find $result "</body>" -1]
:local currentIP [:pick $result $startLoc $endLoc]
:log info "dyndns-update: currentIP = $currentIP"
# Determine if dyndns update is needed
# more dyndns updater request details available at http://www.dyndns.com/developers/specs/syntax.html
:if (($currentIP != $previousIP) || ($dyndnsForce = true)) do={
:set dyndnsForce false
:set previousIP $currentIP
/tool fetch user=$username password=$password mode=http address="members.dyndns.org" src-path="/nic/update?hostname=$hostname&myip=$currentIP" dst-path="/dyndns.txt"
:local result [/file get dyndns.txt contents]
:log info ("dyndns-update: Dyndns update needed")
:log info ("dyndns-update: Dyndns Update Result: ".$result)
:put ("Dyndns Update Result: ".$result)
} else={
:log info ("dyndns-update: No dyndns update needed")
}
Cambiate le variabili inserendo le vostre credenziali:
- :local username "dyndnsUsername"
:local password "dyndnsPassword"
:local hostname "hostname.dyndns.org"
Una volta eseguita questa procedura, apriamo "New terminal" e inseriamo queste linee di comando:
- :global dyndnsForce true
/system script run dyndns-update (esegue lo script) - /system scheduler add comment="" disabled=no interval=15m name=dyndns-update on-event=\
dyndns-update start-date=jan/01/1970 start-time=00:00:00
/system scheduler add comment="" disabled=no interval=1d name=dyndns-force on-event=\
dyndns-force start-date=jan/01/1970 start-time=02:00:00é
_______________________________________________________________________________
(Settiamo lo schedulers in modo da far aggiornare lo script ogni 15 minuti e dyndns-force ogni 24 ore)