diff options
author | Christian Hesse <mail@eworm.de> | 2020-03-05 08:22:47 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2020-03-05 08:22:47 +0100 |
commit | 1dbd91f76d4f5aac19fa8802f38a3d41ae0bec14 (patch) | |
tree | 2b746e0f0db1ebf5f906d4903926782862cec94c /collect-wireless-mac.local | |
parent | f90c59e4fb4ce7d7b71ccfd01755b7b7212fc9d1 (diff) |
collect-wireless-mac: use $LogPrintExit
Diffstat (limited to 'collect-wireless-mac.local')
-rw-r--r-- | collect-wireless-mac.local | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/collect-wireless-mac.local b/collect-wireless-mac.local index cf09fa5..3895ebb 100644 --- a/collect-wireless-mac.local +++ b/collect-wireless-mac.local @@ -9,6 +9,7 @@ :global Identity; :global GetMacVendor; +:global LogPrintExit; :global ScriptLock; :global SendNotification; @@ -16,7 +17,7 @@ $ScriptLock "collect-wireless-mac.local"; :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 ---'."; + $LogPrintExit warn "Added disabled access-list entry with comment '--- collected above ---'." false; } :local PlaceBefore [ / interface wireless access-list find where comment="--- collected above ---" disabled ]; @@ -46,7 +47,7 @@ $ScriptLock "collect-wireless-mac.local"; :local Vendor [ $GetMacVendor $Mac ]; :local Message ("unknown MAC address " . $Mac . " (" . $Vendor . ", " . $HostName . ") " . \ "first seen on " . $DateTime . " connected to SSID " . $Ssid . ", interface " . $Interface); - / log info $Message; + $LogPrintExit info $Message false; / interface wireless access-list add place-before=$PlaceBefore comment=$Message mac-address=$Mac disabled=yes; $SendNotification ($Mac . " connected to " . $Ssid) \ ("A device with unknown MAC address connected to " . $Ssid . " on " . $Identity . ".\n\n" . \ @@ -60,7 +61,7 @@ $ScriptLock "collect-wireless-mac.local"; "DNS name: " . $DnsName . "\n" . \ "Date: " . $DateTime); } else={ - :local Comment [ / interface wireless access-list get $AccessList comment ]; - :log debug ("MAC address " . $Mac . " already known: " . $Comment); + $LogPrintExit debug ("MAC address " . $Mac . " already known: " . \ + [ / interface wireless access-list get $AccessList comment ]) false; } } |