aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-03-08 09:19:43 +0100
committerGravatar Christian Hesse <mail@eworm.de>2024-03-12 15:27:15 +0100
commit3fcdd395fe93a501de297f7678d57b5c1064b05d (patch)
tree90d203fb76220ac0724ac728c11dcc4cc3598bbc
parentffa31c7ad797eb63a896d241651773423c7126aa (diff)
packages-update: support passing backup failure
-rw-r--r--packages-update.rsc6
1 files changed, 6 insertions, 0 deletions
diff --git a/packages-update.rsc b/packages-update.rsc
index e0e1f6d..634b7bb 100644
--- a/packages-update.rsc
+++ b/packages-update.rsc
@@ -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]";