mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-07-15 12:54:24 +02:00
hotspot-to-wpa-cleanup: use $ExitError to indicate unintentional error
This commit is contained in:
parent
90cfa83d95
commit
f7b96aa3e9
3 changed files with 15 additions and 3 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 ];
|
||||||
|
|
||||||
|
@ -23,6 +24,7 @@
|
||||||
:global ScriptLock;
|
:global ScriptLock;
|
||||||
|
|
||||||
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
|
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
|
||||||
|
:set ExitOK true;
|
||||||
:error false;
|
:error false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,4 +74,6 @@
|
||||||
/ip/dhcp-server/lease/remove $Lease;
|
/ip/dhcp-server/lease/remove $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 ];
|
||||||
|
|
||||||
|
@ -24,6 +25,7 @@
|
||||||
:global ScriptLock;
|
:global ScriptLock;
|
||||||
|
|
||||||
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
|
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
|
||||||
|
:set ExitOK true;
|
||||||
:error false;
|
:error false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,4 +81,6 @@
|
||||||
/ip/dhcp-server/lease/remove $Lease;
|
/ip/dhcp-server/lease/remove $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 ];
|
||||||
|
|
||||||
|
@ -23,6 +24,7 @@
|
||||||
:global ScriptLock;
|
:global ScriptLock;
|
||||||
|
|
||||||
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
|
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
|
||||||
|
:set ExitOK true;
|
||||||
:error false;
|
:error false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,4 +74,6 @@
|
||||||
/ip/dhcp-server/lease/remove $Lease;
|
/ip/dhcp-server/lease/remove $Lease;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} on-error={ }
|
} on-error={
|
||||||
|
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue