From 958bfa7ce8d57089b3d66b76eca1c7382f8b4119 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 17 Jan 2020 10:36:03 +0100 Subject: collect-wireless-mac: automatically add missing access-list entry --- collect-wireless-mac.template | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'collect-wireless-mac.template') 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 ]; -- cgit v1.2.3-54-g00ecf