diff options
author | Christian Hesse <mail@eworm.de> | 2024-03-08 17:32:12 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2024-03-12 20:37:57 +0100 |
commit | ba2df80f073caf6b426def177b217d1b37954d7f (patch) | |
tree | 5dadd74e56ded840e62e82127a9315c8769bfd83 /lease-script.rsc | |
parent | 19802c0b6977f9467fada4ace3cab017dd98964b (diff) | |
parent | 242ecef012f5208b6fa088a1222d0d5477e5b2ed (diff) |
Merge branch 'LogPrint' into next
Diffstat (limited to 'lease-script.rsc')
-rw-r--r-- | lease-script.rsc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lease-script.rsc b/lease-script.rsc index 0f6b7f8..8e1e8f6 100644 --- a/lease-script.rsc +++ b/lease-script.rsc @@ -16,7 +16,7 @@ :global Grep; :global IfThenElse; - :global LogPrintExit2; + :global LogPrint; :global ParseKeyValueStore; :global ScriptLock; @@ -24,18 +24,19 @@ [ :typeof $leaseActMAC ] = "nothing" || \ [ :typeof $leaseServerName ] = "nothing" || \ [ :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) \ - "de" "" ] . "assigned lease " . $leaseActIP . " to " . $leaseActMAC) false; + $LogPrint debug $ScriptName ("DHCP Server " . $leaseServerName . " " . [ $IfThenElse ($leaseBound = 0) \ + "de" "" ] . "assigned lease " . $leaseActIP . " to " . $leaseActMAC); :if ([ $ScriptLock $ScriptName 10 ] = false) do={ :error false; } :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; } @@ -49,10 +50,10 @@ :foreach Order,Script in=$RunOrder 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; } on-error={ - $LogPrintExit2 warning $ScriptName ("Running script '" . $Script . "' failed!") false; + $LogPrint warning $ScriptName ("Running script '" . $Script . "' failed!"); } } } on-error={ } |