mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-08-03 09:44:30 +02:00
global: give script or function name in log messages
This commit is contained in:
parent
b0e52aa2d1
commit
f46db91845
46 changed files with 262 additions and 212 deletions
|
@ -6,10 +6,11 @@
|
|||
# visualize ospf instance state via leds
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/ospf-to-leds.md
|
||||
|
||||
:local 0 "ospf-to-leds";
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:global LogPrintExit;
|
||||
:global LogPrintExit2;
|
||||
:global ParseKeyValueStore;
|
||||
|
||||
:foreach Instance in=[ / routing ospf instance find where comment~"^ospf-to-leds," ] do={
|
||||
|
@ -17,7 +18,7 @@
|
|||
:local LED ([ $ParseKeyValueStore ($InstanceVal->"comment") ]->"leds");
|
||||
:local LEDType [ / system leds get [ find where leds=$LED ] type ];
|
||||
|
||||
$LogPrintExit debug ("OSPF instance " . $InstanceVal->"name" . " is " . $InstanceVal->"state" . ".") false;
|
||||
$LogPrintExit2 debug $0 ("OSPF instance " . $InstanceVal->"name" . " is " . $InstanceVal->"state" . ".") false;
|
||||
:if ($InstanceVal->"state" = "running" && $LEDType = "off") do={
|
||||
/ system leds set type=on [ find where leds=$LED ];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue