From f46db918453dcb8878b9a0de6e122fb0ea2224d9 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 22 Feb 2021 15:14:10 +0100 Subject: global: give script or function name in log messages --- hotspot-to-wpa | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'hotspot-to-wpa') diff --git a/hotspot-to-wpa b/hotspot-to-wpa index 09283cf..68f887f 100644 --- a/hotspot-to-wpa +++ b/hotspot-to-wpa @@ -6,10 +6,11 @@ # add private WPA passphrase after hotspot login # https://git.eworm.de/cgit/routeros-scripts/about/doc/hotspot-to-wpa.md +:local 0 "hotspot-to-wpa"; :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } -:global LogPrintExit; +:global LogPrintExit2; :local MacAddress $"mac-address"; :local UserName $username; @@ -18,11 +19,11 @@ :if ([ :len [ / caps-man access-list find where comment="--- hotspot-to-wpa above ---" disabled ] ] = 0) do={ / caps-man access-list add comment="--- hotspot-to-wpa above ---" disabled=yes; - $LogPrintExit warning "Added disabled access-list entry with comment '--- hotspot-to-wpa above ---'." false; + $LogPrintExit2 warning $0 ("Added disabled access-list entry with comment '--- hotspot-to-wpa above ---'.") false; } :local PlaceBefore ([ / caps-man access-list find where comment="--- hotspot-to-wpa above ---" disabled ]->0); -$LogPrintExit info ("Adding/updating accesslist entry for mac address " . $MacAddress . \ +$LogPrintExit2 info $0 ("Adding/updating accesslist entry for mac address " . $MacAddress . \ " (user " . $UserName . ").") false; / caps-man access-list remove [ find where mac-address=$MacAddress comment~"^hotspot-to-wpa: " ]; -- cgit v1.2.3-54-g00ecf