Skip to content

Commit 6bdef64

Browse files
committed
(bluefox) leave backitup enabled after restore
1 parent 9b20d6d commit 6bdef64

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/setup/setupBackup.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,9 @@ function BackupRestore(options) {
313313

314314
function _setObjHelper(_index, _objects, callback) {
315315
// Disable all adapters.
316-
if (_objects[_index].id.match(/^system\.adapter\./) && !_objects[_index].id.match(/^system\.adapter\.admin/)) {
316+
if (_objects[_index].id.match(/^system\.adapter\./)
317+
&& !_objects[_index].id.match(/^system\.adapter\.admin\./)
318+
&& !_objects[_index].id.match(/^system\.adapter\.backitup\./)) {
317319
if (_objects[_index].doc.common && _objects[_index].doc.common.enabled) {
318320
_objects[_index].doc.common.enabled = false;
319321
}
@@ -562,10 +564,11 @@ function BackupRestore(options) {
562564
if (!options.cleanDatabase) throw 'Invalid arguments: cleanDatabase is missing';
563565
if (!options.restartController) throw 'Invalid arguments: restartController is missing';
564566

565-
if (parseInt(name, 10).toString() === name.toString()) {
567+
// If number
568+
if (parseInt(name.trim(), 10).toString() === name.trim().toString()) {
566569
backups = this.listBackups();
567570
backups.sort((a, b) => b > a);
568-
name = backups[parseInt(name, 10)];
571+
name = backups[parseInt(name.trim(), 10)];
569572
console.log('host.' + hostname + ' Using backup file ' + name);
570573
}
571574

0 commit comments

Comments
 (0)