aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-03-08 12:45:37 +0100
committerGravatar Christian Hesse <mail@eworm.de>2024-03-12 20:37:57 +0100
commit5016f4d28ccef4d3b0b1ab55cacb8cf3ee9d0cea (patch)
tree2498cd47bee35e026de132e4c4cf8033b31afc0e
parenta996bdac2aa42728676fe2acc1f0b589aae6673c (diff)
collect-wireless-mac: switch to $LogPrint
-rw-r--r--collect-wireless-mac.capsman.rsc14
-rw-r--r--collect-wireless-mac.local.rsc14
-rw-r--r--collect-wireless-mac.template.rsc18
-rw-r--r--collect-wireless-mac.wifi.rsc14
4 files changed, 30 insertions, 30 deletions
diff --git a/collect-wireless-mac.capsman.rsc b/collect-wireless-mac.capsman.rsc
index 5423624..dcb303c 100644
--- a/collect-wireless-mac.capsman.rsc
+++ b/collect-wireless-mac.capsman.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 [ /caps-man/access-list/find where comment="--- collected above ---" disabled ] ] = 0) do={
/caps-man/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 ([ /caps-man/access-list/find where comment="--- collected above ---" disabled ]->0);
@@ -43,14 +43,14 @@
:do {
:set RegVal [ /caps-man/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 ([ /caps-man/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: " . \
- [ /caps-man/access-list/get $AccessList comment ]) false;
+ $LogPrint debug $ScriptName ("MAC address " . $RegVal->"mac-address" . " already known: " . \
+ [ /caps-man/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;
/caps-man/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={ }
diff --git a/collect-wireless-mac.local.rsc b/collect-wireless-mac.local.rsc
index a4e81a3..7c1122c 100644
--- a/collect-wireless-mac.local.rsc
+++ b/collect-wireless-mac.local.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/wireless/access-list/find where comment="--- collected above ---" disabled ] ] = 0) do={
/interface/wireless/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/wireless/access-list/find where comment="--- collected above ---" disabled ]->0);
@@ -43,14 +43,14 @@
:do {
:set RegVal [ /interface/wireless/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/wireless/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/wireless/access-list/get $AccessList comment ]) false;
+ $LogPrint debug $ScriptName ("MAC address " . $RegVal->"mac-address" . " already known: " . \
+ [ /interface/wireless/access-list/get $AccessList comment ]);
}
:if ([ :len $AccessList ] = 0) do={
@@ -75,7 +75,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/wireless/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"); \
@@ -91,7 +91,7 @@
[ $FormatLine "Date" $DateTime ]) });
}
} else={
- $LogPrintExit2 debug $ScriptName ("No mac address available... Ignoring.") false;
+ $LogPrint debug $ScriptName ("No mac address available... Ignoring.");
}
}
} on-error={ }
diff --git a/collect-wireless-mac.template.rsc b/collect-wireless-mac.template.rsc
index f647eb3..b8c5ff8 100644
--- a/collect-wireless-mac.template.rsc
+++ b/collect-wireless-mac.template.rsc
@@ -24,7 +24,7 @@
:global FormatLine;
:global FormatMultiLines;
:global GetMacVendor;
- :global LogPrintExit2;
+ :global LogPrint;
:global ScriptLock;
:global SendNotification2;
:global SymbolForNotification;
@@ -39,7 +39,7 @@
/caps-man/access-list/add comment="--- collected above ---" disabled=yes;
/interface/wifi/access-list/add comment="--- collected above ---" disabled=yes;
/interface/wireless/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 ([ /caps-man/access-list/find where comment="--- collected above ---" disabled ]->0);
:local PlaceBefore ([ /interface/wifi/access-list/find where comment="--- collected above ---" disabled ]->0);
@@ -54,7 +54,7 @@
:set RegVal [ /interface/wifi/registration-table/get $Reg ];
:set RegVal [ /interface/wireless/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={
@@ -62,10 +62,10 @@
:local AccessList ([ /interface/wifi/access-list/find where mac-address=($RegVal->"mac-address") ]->0);
:local AccessList ([ /interface/wireless/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: " . \
- [ /caps-man/access-list/get $AccessList comment ]) false;
- [ /interface/wifi/access-list/get $AccessList comment ]) false;
- [ /interface/wireless/access-list/get $AccessList comment ]) false;
+ $LogPrint debug $ScriptName ("MAC address " . $RegVal->"mac-address" . " already known: " . \
+ [ /caps-man/access-list/get $AccessList comment ]);
+ [ /interface/wifi/access-list/get $AccessList comment ]);
+ [ /interface/wireless/access-list/get $AccessList comment ]);
}
:if ([ :len $AccessList ] = 0) do={
@@ -90,7 +90,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;
/caps-man/access-list/add place-before=$PlaceBefore comment=$Message mac-address=($RegVal->"mac-address") disabled=yes;
/interface/wifi/access-list/add place-before=$PlaceBefore comment=$Message mac-address=($RegVal->"mac-address") disabled=yes;
/interface/wireless/access-list/add place-before=$PlaceBefore comment=$Message mac-address=($RegVal->"mac-address") disabled=yes;
@@ -108,7 +108,7 @@
[ $FormatLine "Date" $DateTime ]) });
}
} else={
- $LogPrintExit2 debug $ScriptName ("No mac address available... Ignoring.") false;
+ $LogPrint debug $ScriptName ("No mac address available... Ignoring.");
}
}
} on-error={ }
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={ }