mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
backup-partition: pass failure to packages-update
This commit is contained in:
parent
5f41bd1c1e
commit
51b00181cf
1 changed files with 12 additions and 3 deletions
|
@ -15,21 +15,28 @@
|
||||||
:do {
|
:do {
|
||||||
:local ScriptName [ :jobname ];
|
:local ScriptName [ :jobname ];
|
||||||
|
|
||||||
|
:global PackagesUpdateBackupFailure;
|
||||||
|
|
||||||
:global LogPrintExit2;
|
:global LogPrintExit2;
|
||||||
:global ScriptLock;
|
:global ScriptLock;
|
||||||
|
|
||||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||||
|
:set PackagesUpdateBackupFailure true;
|
||||||
:error false;
|
:error false;
|
||||||
}
|
}
|
||||||
|
|
||||||
:if ([ :len [ /partitions/find ] ] < 2) do={
|
:if ([ :len [ /partitions/find ] ] < 2) do={
|
||||||
$LogPrintExit2 error $ScriptName ("Device does not have a fallback partition.") true;
|
$LogPrintExit2 error $ScriptName ("Device does not have a fallback partition.") false;
|
||||||
|
:set PackagesUpdateBackupFailure true;
|
||||||
|
:error false;
|
||||||
}
|
}
|
||||||
|
|
||||||
:local ActiveRunning [ /partitions/find where active running ];
|
:local ActiveRunning [ /partitions/find where active running ];
|
||||||
|
|
||||||
:if ([ :len $ActiveRunning ] < 1) do={
|
:if ([ :len $ActiveRunning ] < 1) do={
|
||||||
$LogPrintExit2 error $ScriptName ("Device is not running from active partition.") true;
|
$LogPrintExit2 error $ScriptName ("Device is not running from active partition.") false;
|
||||||
|
:set PackagesUpdateBackupFailure true;
|
||||||
|
:error false;
|
||||||
}
|
}
|
||||||
|
|
||||||
:local FallbackTo [ /partitions/get $ActiveRunning fallback-to ];
|
:local FallbackTo [ /partitions/get $ActiveRunning fallback-to ];
|
||||||
|
@ -45,6 +52,8 @@
|
||||||
} on-error={
|
} on-error={
|
||||||
/system/scheduler/remove [ find where name="running-from-backup-partition" ];
|
/system/scheduler/remove [ find where name="running-from-backup-partition" ];
|
||||||
$LogPrintExit2 error $ScriptName ("Failed saving configuration to partition '" . \
|
$LogPrintExit2 error $ScriptName ("Failed saving configuration to partition '" . \
|
||||||
$FallbackTo . "'!") true;
|
$FallbackTo . "'!") false;
|
||||||
|
:set PackagesUpdateBackupFailure true;
|
||||||
|
:error false;
|
||||||
}
|
}
|
||||||
} on-error={ }
|
} on-error={ }
|
||||||
|
|
Loading…
Reference in a new issue