aboutsummaryrefslogtreecommitdiffstats
path: root/netwatch-notify.rsc
diff options
context:
space:
mode:
Diffstat (limited to 'netwatch-notify.rsc')
-rw-r--r--netwatch-notify.rsc20
1 files changed, 12 insertions, 8 deletions
diff --git a/netwatch-notify.rsc b/netwatch-notify.rsc
index 8b05c5e..0b8a8dc 100644
--- a/netwatch-notify.rsc
+++ b/netwatch-notify.rsc
@@ -61,15 +61,19 @@
:global GetRandom20CharAlNum;
:local FwAddrList ($ScriptName . "-" . [ $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;
+ :if ([ :typeof [ :toip $Expected ] ] = "ip") do={
+ /ip/firewall/address-list/add address=$Name list=$FwAddrList dynamic=yes timeout=10s;
+ :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 [ /ipv6/firewall/address-list/find where list=$FwAddrList address=$Expected ] ] > 0) do={
- :return true;
+ :if ([ :typeof [ :toip6 $Expected ] ] = "ip6") do={
+ /ipv6/firewall/address-list/add address=$Name list=$FwAddrList dynamic=yes timeout=10s;
+ :delay 20ms;
+ :if ([ :len [ /ipv6/firewall/address-list/find where list=$FwAddrList address=$Expected ] ] > 0) do={
+ :return true;
+ }
}
:return false;