mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
packages-update: support passing backup failure
This commit is contained in:
parent
ffa31c7ad7
commit
3fcdd395fe
1 changed files with 6 additions and 0 deletions
|
@ -23,6 +23,7 @@
|
|||
:global VersionToNum;
|
||||
|
||||
:global PackagesUpdateDeferReboot;
|
||||
:global PackagesUpdateBackupFailure;
|
||||
|
||||
:local Schedule do={
|
||||
:local ScriptName [ :tostr $1 ];
|
||||
|
@ -96,10 +97,15 @@
|
|||
}
|
||||
|
||||
:foreach Order,Script in=$RunOrder do={
|
||||
:set PackagesUpdateBackupFailure false;
|
||||
:do {
|
||||
$LogPrintExit2 info $ScriptName ("Running backup script " . $Script . " before update.") false;
|
||||
/system/script/run $Script;
|
||||
} on-error={
|
||||
:set PackagesUpdateBackupFailure true;
|
||||
}
|
||||
|
||||
:if ($PackagesUpdateBackupFailure = true) do={
|
||||
$LogPrintExit2 warning $ScriptName ("Running backup script " . $Script . " before update failed!") false;
|
||||
:if ([ $ScriptFromTerminal $ScriptName ] = true) do={
|
||||
:put "Do you want to continue anyway? [y/N]";
|
||||
|
|
Loading…
Reference in a new issue