mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-08-08 12:15:19 +02:00
backup-upload: use $ExitError to indicate unintentional error
This commit is contained in:
parent
95030b9b74
commit
268743ef6b
1 changed files with 7 additions and 1 deletions
|
@ -12,6 +12,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 ];
|
||||||
|
|
||||||
|
@ -43,11 +44,13 @@
|
||||||
:if ($BackupSendBinary != true && \
|
:if ($BackupSendBinary != true && \
|
||||||
$BackupSendExport != true) do={
|
$BackupSendExport != true) do={
|
||||||
$LogPrint error $ScriptName ("Configured to send neither backup nor config export.");
|
$LogPrint error $ScriptName ("Configured to send neither backup nor config export.");
|
||||||
|
:set ExitOK true;
|
||||||
:error false;
|
:error false;
|
||||||
}
|
}
|
||||||
|
|
||||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||||
:set PackagesUpdateBackupFailure true;
|
:set PackagesUpdateBackupFailure true;
|
||||||
|
:set ExitOK true;
|
||||||
:error false;
|
:error false;
|
||||||
}
|
}
|
||||||
$WaitFullyConnected;
|
$WaitFullyConnected;
|
||||||
|
@ -67,6 +70,7 @@
|
||||||
|
|
||||||
:if ([ $MkDir $DirName ] = false) do={
|
:if ([ $MkDir $DirName ] = false) do={
|
||||||
$LogPrint error $ScriptName ("Failed creating directory!");
|
$LogPrint error $ScriptName ("Failed creating directory!");
|
||||||
|
:set ExitOK true;
|
||||||
:error false;
|
:error false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,4 +162,6 @@
|
||||||
:set PackagesUpdateBackupFailure true;
|
:set PackagesUpdateBackupFailure true;
|
||||||
}
|
}
|
||||||
/file/remove $DirName;
|
/file/remove $DirName;
|
||||||
} on-error={ }
|
} on-error={
|
||||||
|
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue