aboutsummaryrefslogtreecommitdiffstats
path: root/netwatch-notify.rsc
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-03-03 20:32:23 +0100
committerGravatar Christian Hesse <mail@eworm.de>2024-03-03 20:32:23 +0100
commit64aa6ef1249be378f02b8c211f53a7f12da4f695 (patch)
treecd3c389daed67284e5146d8046b2442f7e16b026 /netwatch-notify.rsc
parent4869d74edf055de1d7a8304a8ac3c29fe11ae3e3 (diff)
netwatch-notify: check one after another
This can bring an extra delay, but saves a check in most cases.
Diffstat (limited to 'netwatch-notify.rsc')
-rw-r--r--netwatch-notify.rsc7
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;
}