mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-01-20 16:09:32 +00:00
backup-upload: early exit with :exit
This commit is contained in:
parent
6f1f60a82b
commit
98bd011984
1 changed files with 5 additions and 10 deletions
|
|
@ -10,7 +10,6 @@
|
|||
# create and upload backup and config file
|
||||
# https://rsc.eworm.de/doc/backup-upload.md
|
||||
|
||||
:local ExitOK false;
|
||||
:onerror Err {
|
||||
:global GlobalConfigReady; :global GlobalFunctionsReady;
|
||||
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
|
||||
|
|
@ -47,21 +46,18 @@
|
|||
:if ($BackupSendBinary != true && \
|
||||
$BackupSendExport != true) do={
|
||||
$LogPrint error $ScriptName ("Configured to send neither backup nor config export.");
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
:exit;
|
||||
}
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:set PackagesUpdateBackupFailure true;
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
:exit;
|
||||
}
|
||||
|
||||
:if ([ :len [ /system/scheduler/find where name="running-from-backup-partition" ] ] > 0) do={
|
||||
$LogPrint warning $ScriptName ("Running from backup partition, refusing to act.");
|
||||
:set PackagesUpdateBackupFailure true;
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
:exit;
|
||||
}
|
||||
|
||||
$WaitFullyConnected;
|
||||
|
|
@ -81,8 +77,7 @@
|
|||
|
||||
:if ([ $MkDir $DirName ] = false) do={
|
||||
$LogPrint error $ScriptName ("Failed creating directory!");
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
:exit;
|
||||
}
|
||||
|
||||
# binary backup
|
||||
|
|
@ -174,5 +169,5 @@
|
|||
}
|
||||
$RmDir $DirName;
|
||||
} do={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
|
||||
:global ExitError; $ExitError false [ :jobname ] $Err;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue