aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2020-03-05 08:22:47 +0100
committerGravatar Christian Hesse <mail@eworm.de>2020-03-05 08:22:47 +0100
commit1dbd91f76d4f5aac19fa8802f38a3d41ae0bec14 (patch)
tree2b746e0f0db1ebf5f906d4903926782862cec94c
parentf90c59e4fb4ce7d7b71ccfd01755b7b7212fc9d1 (diff)
collect-wireless-mac: use $LogPrintExit
-rw-r--r--collect-wireless-mac.capsman9
-rw-r--r--collect-wireless-mac.local9
-rw-r--r--collect-wireless-mac.template9
3 files changed, 15 insertions, 12 deletions
diff --git a/collect-wireless-mac.capsman b/collect-wireless-mac.capsman
index a280cea..771a332 100644
--- a/collect-wireless-mac.capsman
+++ b/collect-wireless-mac.capsman
@@ -9,6 +9,7 @@
:global Identity;
:global GetMacVendor;
+:global LogPrintExit;
:global ScriptLock;
:global SendNotification;
@@ -16,7 +17,7 @@ $ScriptLock "collect-wireless-mac.capsman";
: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 ---'.";
+ $LogPrintExit warn "Added disabled access-list entry with comment '--- collected above ---'." false;
}
:local PlaceBefore [ / caps-man access-list find where comment="--- collected above ---" disabled ];
@@ -46,7 +47,7 @@ $ScriptLock "collect-wireless-mac.capsman";
: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;
/ caps-man 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.capsman";
"DNS name: " . $DnsName . "\n" . \
"Date: " . $DateTime);
} else={
- :local Comment [ / caps-man access-list get $AccessList comment ];
- :log debug ("MAC address " . $Mac . " already known: " . $Comment);
+ $LogPrintExit debug ("MAC address " . $Mac . " already known: " . \
+ [ / caps-man access-list get $AccessList comment ]) false;
}
}
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;
}
}
diff --git a/collect-wireless-mac.template b/collect-wireless-mac.template
index 8f8ded8..199b021 100644
--- a/collect-wireless-mac.template
+++ b/collect-wireless-mac.template
@@ -10,6 +10,7 @@
:global Identity;
:global GetMacVendor;
+:global LogPrintExit;
:global ScriptLock;
:global SendNotification;
@@ -17,7 +18,7 @@ $ScriptLock "collect-wireless-mac%TEMPL%";
: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 ---'.";
+ $LogPrintExit warn "Added disabled access-list entry with comment '--- collected above ---'." false;
}
:local PlaceBefore [ / %PATH% access-list find where comment="--- collected above ---" disabled ];
@@ -48,7 +49,7 @@ $ScriptLock "collect-wireless-mac%TEMPL%";
: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;
/ %PATH% 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" . \
@@ -62,7 +63,7 @@ $ScriptLock "collect-wireless-mac%TEMPL%";
"DNS name: " . $DnsName . "\n" . \
"Date: " . $DateTime);
} else={
- :local Comment [ / %PATH% access-list get $AccessList comment ];
- :log debug ("MAC address " . $Mac . " already known: " . $Comment);
+ $LogPrintExit debug ("MAC address " . $Mac . " already known: " . \
+ [ / %PATH% access-list get $AccessList comment ]) false;
}
}