1
0
mirror of https://github.com/eworm-de/routeros-scripts.git synced 2024-05-11 05:55:19 +00:00

collect-wireless-mac: automatically add missing access-list entry

This commit is contained in:
Christian Hesse
2020-01-17 10:36:03 +01:00
parent 12da4de305
commit 958bfa7ce8
3 changed files with 12 additions and 12 deletions

View File

@ -14,11 +14,11 @@
$ScriptLock "collect-wireless-mac.capsman"; $ScriptLock "collect-wireless-mac.capsman";
:local PlaceBefore [ / caps-man access-list find where comment="--- collected above ---" disabled ]; :if ([ / caps-man access-list print count-only where comment="--- collected above ---" disabled ] = 0) do={
:if ([ :len $PlaceBefore ] = 0) do={ / caps-man access-list add comment="--- collected above ---" disabled=yes;
:log error "Missing disabled access-list entry with comment '--- collected above ---'"; :log warn "Added disabled access-list entry with comment '--- collected above ---'.";
:error "Error: See log for details.";
} }
:local PlaceBefore [ / caps-man access-list find where comment="--- collected above ---" disabled ];
:foreach RegTbl in=[ / caps-man registration-table find ] do={ :foreach RegTbl in=[ / caps-man registration-table find ] do={
:local Mac [ / caps-man registration-table get $RegTbl mac-address ]; :local Mac [ / caps-man registration-table get $RegTbl mac-address ];

View File

@ -14,11 +14,11 @@
$ScriptLock "collect-wireless-mac.local"; $ScriptLock "collect-wireless-mac.local";
:local PlaceBefore [ / interface wireless access-list find where comment="--- collected above ---" disabled ]; :if ([ / interface wireless access-list print count-only where comment="--- collected above ---" disabled ] = 0) do={
:if ([ :len $PlaceBefore ] = 0) do={ / interface wireless access-list add comment="--- collected above ---" disabled=yes;
:log error "Missing disabled access-list entry with comment '--- collected above ---'"; :log warn "Added disabled access-list entry with comment '--- collected above ---'.";
:error "Error: See log for details.";
} }
:local PlaceBefore [ / interface wireless access-list find where comment="--- collected above ---" disabled ];
:foreach RegTbl in=[ / interface wireless registration-table find ] do={ :foreach RegTbl in=[ / interface wireless registration-table find ] do={
:local Mac [ / interface wireless registration-table get $RegTbl mac-address ]; :local Mac [ / interface wireless registration-table get $RegTbl mac-address ];

View File

@ -15,11 +15,11 @@
$ScriptLock "collect-wireless-mac%TEMPL%"; $ScriptLock "collect-wireless-mac%TEMPL%";
:local PlaceBefore [ / %PATH% access-list find where comment="--- collected above ---" disabled ]; :if ([ / %PATH% access-list print count-only where comment="--- collected above ---" disabled ] = 0) do={
:if ([ :len $PlaceBefore ] = 0) do={ / %PATH% access-list add comment="--- collected above ---" disabled=yes;
:log error "Missing disabled access-list entry with comment '--- collected above ---'"; :log warn "Added disabled access-list entry with comment '--- collected above ---'.";
:error "Error: See log for details.";
} }
:local PlaceBefore [ / %PATH% access-list find where comment="--- collected above ---" disabled ];
:foreach RegTbl in=[ / %PATH% registration-table find ] do={ :foreach RegTbl in=[ / %PATH% registration-table find ] do={
:local Mac [ / %PATH% registration-table get $RegTbl mac-address ]; :local Mac [ / %PATH% registration-table get $RegTbl mac-address ];