mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 10:04:19 +02:00
lease-script: switch to $LogPrint
This commit is contained in:
parent
1f938efcaf
commit
29a72e54dc
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
:global Grep;
|
:global Grep;
|
||||||
:global IfThenElse;
|
:global IfThenElse;
|
||||||
:global LogPrintExit2;
|
:global LogPrint;
|
||||||
:global ParseKeyValueStore;
|
:global ParseKeyValueStore;
|
||||||
:global ScriptLock;
|
:global ScriptLock;
|
||||||
|
|
||||||
|
@ -24,18 +24,19 @@
|
||||||
[ :typeof $leaseActMAC ] = "nothing" || \
|
[ :typeof $leaseActMAC ] = "nothing" || \
|
||||||
[ :typeof $leaseServerName ] = "nothing" || \
|
[ :typeof $leaseServerName ] = "nothing" || \
|
||||||
[ :typeof $leaseBound ] = "nothing") do={
|
[ :typeof $leaseBound ] = "nothing") do={
|
||||||
$LogPrintExit2 error $ScriptName ("This script is supposed to run from ip dhcp-server.") true;
|
$LogPrint error $ScriptName ("This script is supposed to run from ip dhcp-server.");
|
||||||
|
:error false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$LogPrintExit2 debug $ScriptName ("DHCP Server " . $leaseServerName . " " . [ $IfThenElse ($leaseBound = 0) \
|
$LogPrint debug $ScriptName ("DHCP Server " . $leaseServerName . " " . [ $IfThenElse ($leaseBound = 0) \
|
||||||
"de" "" ] . "assigned lease " . $leaseActIP . " to " . $leaseActMAC) false;
|
"de" "" ] . "assigned lease " . $leaseActIP . " to " . $leaseActMAC);
|
||||||
|
|
||||||
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
|
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
|
||||||
:error false;
|
:error false;
|
||||||
}
|
}
|
||||||
|
|
||||||
:if ([ :len [ /system/script/job/find where script=$ScriptName ] ] > 1) do={
|
:if ([ :len [ /system/script/job/find where script=$ScriptName ] ] > 1) do={
|
||||||
$LogPrintExit2 debug $ScriptName ("More invocations are waiting, exiting early.") false;
|
$LogPrint debug $ScriptName ("More invocations are waiting, exiting early.");
|
||||||
:error true;
|
:error true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,10 +50,10 @@
|
||||||
|
|
||||||
:foreach Order,Script in=$RunOrder do={
|
:foreach Order,Script in=$RunOrder do={
|
||||||
:do {
|
:do {
|
||||||
$LogPrintExit2 debug $ScriptName ("Running script with order " . $Order . ": " . $Script) false;
|
$LogPrint debug $ScriptName ("Running script with order " . $Order . ": " . $Script);
|
||||||
/system/script/run $Script;
|
/system/script/run $Script;
|
||||||
} on-error={
|
} on-error={
|
||||||
$LogPrintExit2 warning $ScriptName ("Running script '" . $Script . "' failed!") false;
|
$LogPrint warning $ScriptName ("Running script '" . $Script . "' failed!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} on-error={ }
|
} on-error={ }
|
||||||
|
|
Loading…
Reference in a new issue