diff options
author | Christian Hesse <mail@eworm.de> | 2021-06-23 10:56:30 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2021-06-23 15:15:19 +0200 |
commit | f26b3da34224a6b4827f785ab82b1e9eaa40f021 (patch) | |
tree | 2d856f04a4c3931c20122801c1ab5f4dde26b116 /lease-script | |
parent | cd0398acf9ccfcd488f0b8e9044f9789368937a1 (diff) |
lease-script: use $LogPrintExit2
This will never print to terminal, nevertheless we want proper
log with script name in prefix.
Diffstat (limited to 'lease-script')
-rw-r--r-- | lease-script | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lease-script b/lease-script index 72f96eb..b7a4976 100644 --- a/lease-script +++ b/lease-script @@ -22,8 +22,8 @@ :local State ([ $IfThenElse ($leaseBound = 0) "de" "" ] . "assign"); -:log debug ("DHCP Server " . $leaseServerName . " " . \ - $State . "ed lease " . $leaseActIP . " to " . $leaseActMAC); +$LogPrintExit2 debug $0 ("DHCP Server " . $leaseServerName . " " . \ + $State . "ed lease " . $leaseActIP . " to " . $leaseActMAC) false; # delay a moment to update the lease table, do not run in parallel for de/assign :delay ((1 + $leaseBound) . "s"); @@ -31,9 +31,9 @@ :foreach Script in=[ / system script find where source~("\n# provides: lease-script " . $State . "\n") ] do={ :local ScriptName [ / system script get $Script name ]; :do { - :log debug ("Running script from lease-script: " . $ScriptName); + $LogPrintExit2 debug $0 ("Running script: " . $ScriptName) false; / system script run $Script; } on-error={ - :log warning ("Running script '" . $ScriptName . "' from lease-script failed!"); + $LogPrintExit2 warning $0 ("Running script '" . $ScriptName . "' failed!") false; } } |