mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-24 12:54:28 +02:00
netwatch-notify: check matching address type only
This commit is contained in:
parent
1555426687
commit
b63e0fcb2f
1 changed files with 12 additions and 8 deletions
|
@ -61,15 +61,19 @@
|
|||
:global GetRandom20CharAlNum;
|
||||
|
||||
:local FwAddrList ($ScriptName . "-" . [ $GetRandom20CharAlNum ]);
|
||||
/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;
|
||||
: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=10s;
|
||||
: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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue