aboutsummaryrefslogtreecommitdiffstats
path: root/collect-wireless-mac.wifi.rsc
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-03-08 17:32:12 +0100
committerGravatar Christian Hesse <mail@eworm.de>2024-03-12 20:37:57 +0100
commitba2df80f073caf6b426def177b217d1b37954d7f (patch)
tree5dadd74e56ded840e62e82127a9315c8769bfd83 /collect-wireless-mac.wifi.rsc
parent19802c0b6977f9467fada4ace3cab017dd98964b (diff)
parent242ecef012f5208b6fa088a1222d0d5477e5b2ed (diff)
Merge branch 'LogPrint' into next
Diffstat (limited to 'collect-wireless-mac.wifi.rsc')
-rw-r--r--collect-wireless-mac.wifi.rsc14
1 files changed, 7 insertions, 7 deletions
diff --git a/collect-wireless-mac.wifi.rsc b/collect-wireless-mac.wifi.rsc
index 063d6dc..b8ad939 100644
--- a/collect-wireless-mac.wifi.rsc
+++ b/collect-wireless-mac.wifi.rsc
@@ -23,7 +23,7 @@
:global FormatLine;
:global FormatMultiLines;
:global GetMacVendor;
- :global LogPrintExit2;
+ :global LogPrint;
:global ScriptLock;
:global SendNotification2;
:global SymbolForNotification;
@@ -34,7 +34,7 @@
:if ([ :len [ /interface/wifi/access-list/find where comment="--- collected above ---" disabled ] ] = 0) do={
/interface/wifi/access-list/add comment="--- collected above ---" disabled=yes;
- $LogPrintExit2 warning $ScriptName ("Added disabled access-list entry with comment '--- collected above ---'.") false;
+ $LogPrint warning $ScriptName ("Added disabled access-list entry with comment '--- collected above ---'.");
}
:local PlaceBefore ([ /interface/wifi/access-list/find where comment="--- collected above ---" disabled ]->0);
@@ -43,14 +43,14 @@
:do {
:set RegVal [ /interface/wifi/registration-table/get $Reg ];
} on-error={
- $LogPrintExit2 debug $ScriptName ("Device already gone... Ignoring.") false;
+ $LogPrint debug $ScriptName ("Device already gone... Ignoring.");
}
:if ([ :len ($RegVal->"mac-address") ] > 0) do={
:local AccessList ([ /interface/wifi/access-list/find where mac-address=($RegVal->"mac-address") ]->0);
:if ([ :len $AccessList ] > 0) do={
- $LogPrintExit2 debug $ScriptName ("MAC address " . $RegVal->"mac-address" . " already known: " . \
- [ /interface/wifi/access-list/get $AccessList comment ]) false;
+ $LogPrint debug $ScriptName ("MAC address " . $RegVal->"mac-address" . " already known: " . \
+ [ /interface/wifi/access-list/get $AccessList comment ]);
}
:if ([ :len $AccessList ] = 0) do={
@@ -74,7 +74,7 @@
:local Vendor [ $GetMacVendor ($RegVal->"mac-address") ];
:local Message ("MAC address " . $RegVal->"mac-address" . " (" . $Vendor . ", " . $HostName . ") " . \
"first seen on " . $DateTime . " connected to SSID " . $RegVal->"ssid" . ", interface " . $RegVal->"interface");
- $LogPrintExit2 info $ScriptName $Message false;
+ $LogPrint info $ScriptName $Message;
/interface/wifi/access-list/add place-before=$PlaceBefore comment=$Message mac-address=($RegVal->"mac-address") disabled=yes;
$SendNotification2 ({ origin=$ScriptName; \
subject=([ $SymbolForNotification "mobile-phone" ] . $RegVal->"mac-address" . " connected to " . $RegVal->"ssid"); \
@@ -90,7 +90,7 @@
[ $FormatLine "Date" $DateTime ]) });
}
} else={
- $LogPrintExit2 debug $ScriptName ("No mac address available... Ignoring.") false;
+ $LogPrint debug $ScriptName ("No mac address available... Ignoring.");
}
}
} on-error={ }