Code:
# DNSoMatic automatic DNS updates
#--------------- Change Values in this section to match your setup ------------------
# User account info of DNSoMatic
:local maticuser USER_OD_DNS_O_MATIC
:local maticpass PASS_OD_DNS_O_MATIC
# Set the hostname or label of network to be updated. This is the part after the double colon (::) on the DNSoMatic services page.
# Hostnames with spaces are unsupported. Replace the value in the quotations below with your host names.
# To specify multiple hosts, separate them with commas.
# Use "all.dnsomatic.com" for the matichost to update all items in dnsomatic with this IP.
:local matichost HOST.dyndns.XXX
#NEW
:global previousIP;
:global currentIP [:resolve myip.opendns.com server=208.67.222.222];
:if ($currentIP != $previousIP) do={
:log info "DNSoMatic: Update needed"
:set previousIP $currentIP
# The update URL. Note the "\3F" is hex for question mark (?). Required since ? is a special character in commands.
:local url "http://updates.dnsomatic.com/nic/update\3Fmyip=$currentIP&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG"
:local matichostarray;
:set matichostarray [:toarray $matichost];
:foreach host in=$matichostarray do={
:log info "DNSoMatic: Sending update for $host"
/tool fetch url=($url . "&hostname=$host") user=$maticuser password=$maticpass mode=http dst-path=("dnsomaticupdate-" . $host . ".txt")
:log info "DNSoMatic: Host $host updated on DNSoMatic with IP $currentIP"
}
} else={}
evo ti skripte ..
scheduler znaš valjda slozit ili ?
Code:
/system scheduler
add interval=5m name=dnsOmatic_run on-event="/system script run dnsOmatic" \
policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
start-date=feb/01/2017 start-time=23:56:00
Dakle na dns-o-matic stranici imam acc
tamo sam upisao dyndns podatke
user i API key .. ne password
i tako radi ok..
ako zapneš .. javi se