aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2020-01-17 10:36:03 +0100
committerGravatar Christian Hesse <mail@eworm.de>2020-01-17 10:36:03 +0100
commit958bfa7ce8d57089b3d66b76eca1c7382f8b4119 (patch)
tree5e6f706e8f700e9e4c4dc0dbcac9ae0dfee53dd0
parent12da4de305421fe155e352cc9b1396f56338516e (diff)
collect-wireless-mac: automatically add missing access-list entry
-rw-r--r--collect-wireless-mac.capsman8
-rw-r--r--collect-wireless-mac.local8
-rw-r--r--collect-wireless-mac.template8
3 files changed, 12 insertions, 12 deletions
diff --git a/collect-wireless-mac.capsman b/collect-wireless-mac.capsman
index 2b93e09..2b9b23f 100644
--- a/collect-wireless-mac.capsman
+++ b/collect-wireless-mac.capsman
@@ -14,11 +14,11 @@
$ScriptLock "collect-wireless-mac.capsman";
-:local PlaceBefore [ / caps-man access-list find where comment="--- collected above ---" disabled ];
-:if ([ :len $PlaceBefore ] = 0) do={
- :log error "Missing disabled access-list entry with comment '--- collected above ---'";
- :error "Error: See log for details.";
+:if ([ / caps-man access-list print count-only where comment="--- collected above ---" disabled ] = 0) do={
+ / caps-man access-list add comment="--- collected above ---" disabled=yes;
+ :log warn "Added disabled access-list entry with comment '--- collected above ---'.";
}
+:local PlaceBefore [ / caps-man access-list find where comment="--- collected above ---" disabled ];
:foreach RegTbl in=[ / caps-man registration-table find ] do={
:local Mac [ / caps-man registration-table get $RegTbl mac-address ];
diff --git a/collect-wireless-mac.local b/collect-wireless-mac.local
index c38c2c1..3241c27 100644
--- a/collect-wireless-mac.local
+++ b/collect-wireless-mac.local
@@ -14,11 +14,11 @@
$ScriptLock "collect-wireless-mac.local";
-:local PlaceBefore [ / interface wireless access-list find where comment="--- collected above ---" disabled ];
-:if ([ :len $PlaceBefore ] = 0) do={
- :log error "Missing disabled access-list entry with comment '--- collected above ---'";
- :error "Error: See log for details.";
+:if ([ / interface wireless access-list print count-only where comment="--- collected above ---" disabled ] = 0) do={
+ / interface wireless access-list add comment="--- collected above ---" disabled=yes;
+ :log warn "Added disabled access-list entry with comment '--- collected above ---'.";
}
+:local PlaceBefore [ / interface wireless access-list find where comment="--- collected above ---" disabled ];
:foreach RegTbl in=[ / interface wireless registration-table find ] do={
:local Mac [ / interface wireless registration-table get $RegTbl mac-address ];
diff --git a/collect-wireless-mac.template b/collect-wireless-mac.template
index 03bd532..6ad55a2 100644
--- a/collect-wireless-mac.template
+++ b/collect-wireless-mac.template
@@ -15,11 +15,11 @@
$ScriptLock "collect-wireless-mac%TEMPL%";
-:local PlaceBefore [ / %PATH% access-list find where comment="--- collected above ---" disabled ];
-:if ([ :len $PlaceBefore ] = 0) do={
- :log error "Missing disabled access-list entry with comment '--- collected above ---'";
- :error "Error: See log for details.";
+:if ([ / %PATH% access-list print count-only where comment="--- collected above ---" disabled ] = 0) do={
+ / %PATH% access-list add comment="--- collected above ---" disabled=yes;
+ :log warn "Added disabled access-list entry with comment '--- collected above ---'.";
}
+:local PlaceBefore [ / %PATH% access-list find where comment="--- collected above ---" disabled ];
:foreach RegTbl in=[ / %PATH% registration-table find ] do={
:local Mac [ / %PATH% registration-table get $RegTbl mac-address ];