Community discussions

MikroTik App
 
minelli
newbie
Topic Author
Posts: 41
Joined: Tue Feb 26, 2008 2:36 am

Script DDNS in Hash

Thu Dec 03, 2009 8:05 pm

Would like to know how to convert the script ddns below:
#=======================================#
# Edite seus detalhes / Configurando abaixo.
#=======================================#
:global ddnsuser "user"
:global ddnspass "senha"
:global ddnshost "provedor.changeip.org"
:global ddnsinterface "interface"
#=======================================#
# Fim da definicao das configuracoes do usuario.
#=======================================#
 
:global ddnssystem ("mt-" . [/system package get [/system package find name=system] version] )
:global ddnsip [ /ip address get [/ip address find interface=$ddnsinterface] address ]
:global ddnslastip
 
:if ([:len [/interface find name=$ddnsinterface]] = 0 ) do={ :log info "DDNS: Interface nao existe $ddnsinterface, por favor verifique a configuracao." }
 
:if ([ :typeof $ddnslastip ] = "nothing" ) do={ :global ddnslastip 0.0.0.0/0 }
 
:if ([ :typeof $ddnsip ] = "nothing" ) do={
 
:log info ("DDNS: Nenhum IP presente na interface " . $ddnsinterface . ", por favor verifique.")
 
} else={
 
  :if ($ddnsip != $ddnslastip) do={
 
    :log info "DDNS: Enviando atualizacao!"
    :log info [ :put [/tool dns-update name=$ddnshost address=[:pick $ddnsip 0 [:find $ddnsip "/"] ] key-name=$ddnsuser key=$ddnspass ] ]
    :global ddnslastip $ddnsip
 
  } else={ 
 
    :log info "DDNS: Atualizacao desnecessaria."
 
  }
 
}
To be implemented in hash as this one:
:log warning ";ddns: ;140;f718499c1c8cef6730f9fd03c8125cab"
In / system script in 4.3 MK

I thank Minelli. '.
 
minelli
newbie
Topic Author
Posts: 41
Joined: Tue Feb 26, 2008 2:36 am

Re: Script DDNS in Hash

Wed Dec 09, 2009 1:47 pm

Help-me???
 
changeip
Forum Guru
Forum Guru
Posts: 3819
Joined: Fri May 28, 2004 5:22 pm

Re: Script DDNS in Hash

Wed Dec 09, 2009 7:34 pm

i dont understand your question. can you explain what you are trying to accomplish in more detail?
Colo and Wholesale Bandwidth Available! Sales at SanDiegoBroadband dot com
 
minelli
newbie
Topic Author
Posts: 41
Joined: Tue Feb 26, 2008 2:36 am

Re: Script DDNS in Hash

Thu Dec 10, 2009 3:24 am

I want to know how to make the first script to run the second form.
For example in the first script I have information like User and password that everyone can see. In the second form can not view this information, so I avoid knowing the data.
 
User avatar
soho
newbie
Posts: 30
Joined: Sat Sep 09, 2006 3:05 am

Re: Script DDNS in Hash

Mon Dec 14, 2009 2:46 pm

hi Minelli.


hexa??


view example bellow:
:put "\48\45\4C\4C\4F\r\nThis\r\nis\r\na\r\ntest";
which will show on display
HELLO
This
is
a
test
font: http://wiki.mikrotik.com/wiki/Scripting

Who is online

Users browsing this forum: Google [Bot] and 18 guests