Na update change.ip pouzivam tento script
# Define User Variables
:global ddnsuser "uzivatelske_meno"
:global ddnspass "heslo"
:global ddnshost "nieco_moje.com"
# Define Global Variables
:global ddnsip
:global ddnslastip
:if ([ :typeof $ddnslastip ] = nil ) do={ :global ddnslastip "0" }
:global ddnsinterface
:global ddnssystem ("mt-" . [/system package get system version] )
# Define Local Variables
:local int
# Loop thru interfaces and look for ones containing
# default gateways without routing-marks
#:foreach int in=[/ip route find dst-address=0.0.0.0/0 active=yes ] do={
# :if ([:typeof [/ip route get $int routing-mark ]] != str ) do={
# :global ddnsinterface [/ip route get $int interface]
# }
#}
:global ddnsinterface "pppoe-out1"
# Grab the current IP address on that interface.
:global ddnsip [ /ip address get [/ip address find interface=$ddnsinterface ] address ]
# Did we get an IP address to compare?
:if ([ :typeof $ddnsip ] = nil ) do={
:log info ("DDNS: No ip address present on " . $ddnsinterface . ", please check.")
} else={
:if ($ddnsip != $ddnslastip) do={
:log info "DDNS: Sending UPDATE!"
: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: No update required."
}
}
# End of script
Nie som ziadny koder, takze nedokazem si upravit script. V podstate mi ide o to, aby sa mi to zbytocne nelogovalo. Aj ked mam nastaveny update na 1-2 hod. tak polovica logu je od toho scriptu, ze sa nic nemuselo updatovat (mam v tomto scripte 5 domenovych mien + este dalsi script mam na noip.com).
Ano viem, mozem si log posielat niekde na server mimo MK, ale to neni potrebne. Log mam nastaveny na 1000 riadkov a to mi staci (je to na domace pouzitie).
Preto som uvazoval ako poriesit spustanie toho scriptu, len po uspesnom naviazani pppoe spojenia.
Viem, ze spustanie toho scriptu nema vplyv na vykon MK, ale zbytocne loguje to co nemusi