Answer the question
In order to leave comments, you need to log in
How to handle Exception in Microtrik scripts?
Mikrotik RouterOS v6.17
piece of iron 2011UiAS-2HnD
line from the script
:local InterfaceISP2Address [/ip address get [find interface=ether2] address]
Answer the question
In order to leave comments, you need to log in
For example, like this:
:local interfaceName "ether2"
:local InterfaceISP2Address
:if ([ :len [ /interface find name=$interfaceName ] ] = 0 ) do={
:log warning "[SCRIPT_NAME] No interface '$interfaceName' was found, please do check updater script configuration."
:set InterfaceISP2Address "0.0.0.0/0"
} else={
# Get current IP address for the interface
:set InterfaceISP2Address [ :tostr [ /ip address get [/ip address find interface=$interfaceName] address ] ]
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question