mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
netwatch-notify: check one after another
This can bring an extra delay, but saves a check in most cases.
This commit is contained in:
parent
4869d74edf
commit
64aa6ef124
1 changed files with 5 additions and 2 deletions
|
@ -60,10 +60,13 @@
|
||||||
|
|
||||||
:local FwAddrList ($0 . "-" . [ $GetRandom20CharAlNum ]);
|
:local FwAddrList ($0 . "-" . [ $GetRandom20CharAlNum ]);
|
||||||
/ip/firewall/address-list/add address=$Name list=$FwAddrList dynamic=yes timeout=1s;
|
/ip/firewall/address-list/add address=$Name list=$FwAddrList dynamic=yes timeout=1s;
|
||||||
|
:delay 20ms;
|
||||||
|
:if ([ :len [ /ip/firewall/address-list/find where list=$FwAddrList address=$Expected ] ] > 0) do={
|
||||||
|
:return true;
|
||||||
|
}
|
||||||
/ipv6/firewall/address-list/add address=$Name list=$FwAddrList dynamic=yes timeout=1s;
|
/ipv6/firewall/address-list/add address=$Name list=$FwAddrList dynamic=yes timeout=1s;
|
||||||
:delay 20ms;
|
:delay 20ms;
|
||||||
:if ([ :len [ /ip/firewall/address-list/find where list=$FwAddrList address=$Expected ] ] > 0 || \
|
:if ([ :len [ /ipv6/firewall/address-list/find where list=$FwAddrList address=$Expected ] ] > 0) do={
|
||||||
[ :len [ /ipv6/firewall/address-list/find where list=$FwAddrList address=$Expected ] ] > 0) do={
|
|
||||||
:return true;
|
:return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue