mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
hotspot-to-wpa-cleanup: drop main function, use :do with on-error
This commit is contained in:
parent
47b67af226
commit
b622f47d65
3 changed files with 12 additions and 18 deletions
|
@ -14,8 +14,8 @@
|
|||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local Main do={
|
||||
:local ScriptName [ :tostr $1 ];
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
:global EitherOr;
|
||||
:global LogPrintExit2;
|
||||
|
@ -23,7 +23,7 @@
|
|||
:global ScriptLock;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
|
||||
:return false;
|
||||
:error false;
|
||||
}
|
||||
|
||||
:local DHCPServers ({});
|
||||
|
@ -71,6 +71,4 @@
|
|||
/ip/dhcp-server/lease/remove $Lease;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$Main [ :jobname ];
|
||||
} on-error={ }
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local Main do={
|
||||
:local ScriptName [ :tostr $1 ];
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
:global EitherOr;
|
||||
:global LogPrintExit2;
|
||||
|
@ -24,7 +24,7 @@
|
|||
:global ScriptLock;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
|
||||
:return false;
|
||||
:error false;
|
||||
}
|
||||
|
||||
:local DHCPServers ({});
|
||||
|
@ -78,6 +78,4 @@
|
|||
/ip/dhcp-server/lease/remove $Lease;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$Main [ :jobname ];
|
||||
} on-error={ }
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local Main do={
|
||||
:local ScriptName [ :tostr $1 ];
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
:global EitherOr;
|
||||
:global LogPrintExit2;
|
||||
|
@ -23,7 +23,7 @@
|
|||
:global ScriptLock;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
|
||||
:return false;
|
||||
:error false;
|
||||
}
|
||||
|
||||
:local DHCPServers ({});
|
||||
|
@ -71,6 +71,4 @@
|
|||
/ip/dhcp-server/lease/remove $Lease;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$Main [ :jobname ];
|
||||
} on-error={ }
|
||||
|
|
Loading…
Reference in a new issue