evo ljudi sredio sam napokon vrijedilo je truda citav dan sam jucer proveo na netu trazeci skiptu koja je proradit..i Nasao sam je radi svakih 15 minuta update malo dugo ali bolje ista nego nista..bolje i to ko sto ti rece kolega nego da me banuju ili blokiraju nalog..kad nastimam svake 3 sec ili 1 min.
Dodaju sve prvo dvije ove skripte "dyndns-update" i "dyndns-force". Policy za skripte obavezno stavit samo: Reboot,write,test,read,policy,pasword.
The Script "dyndns-update". Set the local variables username, password and hostname:
# 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")
}
Script "dyndns-force". Intended to update dyndns only once every 24 hrs. If you run this too much, you may get locked out of dyndns.
:global dyndnsForce true
/system script run dyndns-update
Kad smo dodali ove dvije skripte gore posebno..onda dodajemo sad scheduler i za njeg Policy ide: write,test,read,policy,pasword.
Setup the schedulers. Run dyndns-update every 15 minutes and dyndns-force once every 24 hours:
/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
[Ovu poruku je menjao berny8 dana 29.06.2010. u 10:39 GMT+1]