diff options
author | Christian Hesse <mail@eworm.de> | 2024-03-03 20:32:23 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2024-03-03 20:32:23 +0100 |
commit | 64aa6ef1249be378f02b8c211f53a7f12da4f695 (patch) | |
tree | cd3c389daed67284e5146d8046b2442f7e16b026 | |
parent | 4869d74edf055de1d7a8304a8ac3c29fe11ae3e3 (diff) |
netwatch-notify: check one after another
This can bring an extra delay, but saves a check in most cases.
-rw-r--r-- | netwatch-notify.rsc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/netwatch-notify.rsc b/netwatch-notify.rsc index 5fde355..8c59af8 100644 --- a/netwatch-notify.rsc +++ b/netwatch-notify.rsc @@ -60,10 +60,13 @@ :local FwAddrList ($0 . "-" . [ $GetRandom20CharAlNum ]); /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; :delay 20ms; - :if ([ :len [ /ip/firewall/address-list/find where list=$FwAddrList address=$Expected ] ] > 0 || \ - [ :len [ /ipv6/firewall/address-list/find where list=$FwAddrList address=$Expected ] ] > 0) do={ + :if ([ :len [ /ipv6/firewall/address-list/find where list=$FwAddrList address=$Expected ] ] > 0) do={ :return true; } |