mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
backup-partition: drop main function, use :do with on-error
This commit is contained in:
parent
3eb8fad5ae
commit
b8bd64bac5
1 changed files with 4 additions and 6 deletions
|
@ -12,14 +12,14 @@
|
||||||
:global GlobalFunctionsReady;
|
:global GlobalFunctionsReady;
|
||||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:local Main do={
|
:do {
|
||||||
:local ScriptName [ :tostr $1 ];
|
:local ScriptName [ :jobname ];
|
||||||
|
|
||||||
:global LogPrintExit2;
|
:global LogPrintExit2;
|
||||||
:global ScriptLock;
|
:global ScriptLock;
|
||||||
|
|
||||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||||
:return false;
|
:error false;
|
||||||
}
|
}
|
||||||
|
|
||||||
:if ([ :len [ /partitions/find ] ] < 2) do={
|
:if ([ :len [ /partitions/find ] ] < 2) do={
|
||||||
|
@ -47,6 +47,4 @@
|
||||||
$LogPrintExit2 error $ScriptName ("Failed saving configuration to partition '" . \
|
$LogPrintExit2 error $ScriptName ("Failed saving configuration to partition '" . \
|
||||||
$FallbackTo . "'!") true;
|
$FallbackTo . "'!") true;
|
||||||
}
|
}
|
||||||
}
|
} on-error={ }
|
||||||
|
|
||||||
$Main [ :jobname ];
|
|
||||||
|
|
Loading…
Reference in a new issue