Hello,
I’m trying to create a script which sends WoL packet as soon as an interface becomes active, but it doesn’t seem to work without :delay 20 or so. My intention was to loop around the interface until it has running=true condition and then send the packet, but it doesn’t seem execute at all.
So I’ve created a test script like this to debug the problem:
:log info "START"
:if ([/interface ethernet get [/interface find name="ether2"] running]=true) do={
:log info "COND - ether2 running"
} else= {
:log info "COND - ether2 not active"
}
:log info "END"
The thing is - when script is run via scheduler on boot, it only executes: :log info “START” then apparently dies. It does not log neither first, nor second condition and not even :log info “END”. If I run the script manually via “system scheduler run ID” it executes completely. Why exactly is that? I think that even if condition does not exist yet it should simply skip the whole if loop and at least print the END log and not simply die in the middle of the script.
I don’t want to use :delay at the beginning of the script as it may lead to timing issues, plus I want WoL packet to be send the moment interface is in running state and not with some arbitrary delay.