mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-13 11:34:31 +02:00
dhcp-lease-comment: use $ExitError to indicate unintentional error
This commit is contained in:
parent
f9a6916827
commit
87cde2cc2f
4 changed files with 20 additions and 4 deletions
|
@ -14,6 +14,7 @@
|
||||||
:global GlobalFunctionsReady;
|
:global GlobalFunctionsReady;
|
||||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
|
:local ExitOK false;
|
||||||
:do {
|
:do {
|
||||||
:local ScriptName [ :jobname ];
|
:local ScriptName [ :jobname ];
|
||||||
|
|
||||||
|
@ -21,6 +22,7 @@
|
||||||
:global ScriptLock;
|
:global ScriptLock;
|
||||||
|
|
||||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||||
|
:set ExitOK true;
|
||||||
:error false;
|
:error false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,4 +38,6 @@
|
||||||
/ip/dhcp-server/lease/set comment=$NewComment $Lease;
|
/ip/dhcp-server/lease/set comment=$NewComment $Lease;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} on-error={ }
|
} on-error={
|
||||||
|
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||||
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
:global GlobalFunctionsReady;
|
:global GlobalFunctionsReady;
|
||||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
|
:local ExitOK false;
|
||||||
:do {
|
:do {
|
||||||
:local ScriptName [ :jobname ];
|
:local ScriptName [ :jobname ];
|
||||||
|
|
||||||
|
@ -21,6 +22,7 @@
|
||||||
:global ScriptLock;
|
:global ScriptLock;
|
||||||
|
|
||||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||||
|
:set ExitOK true;
|
||||||
:error false;
|
:error false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,4 +38,6 @@
|
||||||
/ip/dhcp-server/lease/set comment=$NewComment $Lease;
|
/ip/dhcp-server/lease/set comment=$NewComment $Lease;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} on-error={ }
|
} on-error={
|
||||||
|
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||||
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
:global GlobalFunctionsReady;
|
:global GlobalFunctionsReady;
|
||||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
|
:local ExitOK false;
|
||||||
:do {
|
:do {
|
||||||
:local ScriptName [ :jobname ];
|
:local ScriptName [ :jobname ];
|
||||||
|
|
||||||
|
@ -22,6 +23,7 @@
|
||||||
:global ScriptLock;
|
:global ScriptLock;
|
||||||
|
|
||||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||||
|
:set ExitOK true;
|
||||||
:error false;
|
:error false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,4 +43,6 @@
|
||||||
/ip/dhcp-server/lease/set comment=$NewComment $Lease;
|
/ip/dhcp-server/lease/set comment=$NewComment $Lease;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} on-error={ }
|
} on-error={
|
||||||
|
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||||
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
:global GlobalFunctionsReady;
|
:global GlobalFunctionsReady;
|
||||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
|
:local ExitOK false;
|
||||||
:do {
|
:do {
|
||||||
:local ScriptName [ :jobname ];
|
:local ScriptName [ :jobname ];
|
||||||
|
|
||||||
|
@ -21,6 +22,7 @@
|
||||||
:global ScriptLock;
|
:global ScriptLock;
|
||||||
|
|
||||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||||
|
:set ExitOK true;
|
||||||
:error false;
|
:error false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,4 +38,6 @@
|
||||||
/ip/dhcp-server/lease/set comment=$NewComment $Lease;
|
/ip/dhcp-server/lease/set comment=$NewComment $Lease;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} on-error={ }
|
} on-error={
|
||||||
|
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue