mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 10:04:19 +02:00
backup-partition: switch to $LogPrint
This commit is contained in:
parent
4b69144ee4
commit
b879f8fef2
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
:global PackagesUpdateBackupFailure;
|
:global PackagesUpdateBackupFailure;
|
||||||
|
|
||||||
:global LogPrintExit2;
|
:global LogPrint;
|
||||||
:global ScriptLock;
|
:global ScriptLock;
|
||||||
|
|
||||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
:if ([ :len [ /partitions/find ] ] < 2) do={
|
:if ([ :len [ /partitions/find ] ] < 2) do={
|
||||||
$LogPrintExit2 error $ScriptName ("Device does not have a fallback partition.") false;
|
$LogPrint error $ScriptName ("Device does not have a fallback partition.");
|
||||||
:set PackagesUpdateBackupFailure true;
|
:set PackagesUpdateBackupFailure true;
|
||||||
:error false;
|
:error false;
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
: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.") false;
|
$LogPrint error $ScriptName ("Device is not running from active partition.");
|
||||||
:set PackagesUpdateBackupFailure true;
|
:set PackagesUpdateBackupFailure true;
|
||||||
:error false;
|
:error false;
|
||||||
}
|
}
|
||||||
|
@ -47,12 +47,10 @@
|
||||||
"[ /partitions/get [ find where running ] name ] . \"'!\")");
|
"[ /partitions/get [ find where running ] name ] . \"'!\")");
|
||||||
/partitions/save-config-to $FallbackTo;
|
/partitions/save-config-to $FallbackTo;
|
||||||
/system/scheduler/remove "running-from-backup-partition";
|
/system/scheduler/remove "running-from-backup-partition";
|
||||||
$LogPrintExit2 info $ScriptName ("Saved configuration to partition '" . \
|
$LogPrint info $ScriptName ("Saved configuration to partition '" . $FallbackTo . "'.");
|
||||||
$FallbackTo . "'.") false;
|
|
||||||
} 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 '" . \
|
$LogPrint error $ScriptName ("Failed saving configuration to partition '" . $FallbackTo . "'!");
|
||||||
$FallbackTo . "'!") false;
|
|
||||||
:set PackagesUpdateBackupFailure true;
|
:set PackagesUpdateBackupFailure true;
|
||||||
:error false;
|
:error false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue