Skip to content

Commit

Permalink
Repair docker auto update (again)
Browse files Browse the repository at this point in the history
  • Loading branch information
Commifreak committed Aug 28, 2023
1 parent 046f3b5 commit 24310fa
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/scripts/backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,30 +267,30 @@
goto abort;
}

ABHelper::backupLog("Starting Docker auto-update check...");
foreach ($sortedStopContainers as $container) {
$containerSettings = $abSettings->getContainerSpecificSettings($container['Name']);
if ($containerSettings['updateContainer'] == 'yes') {
ABHelper::backupLog("Auto-Update for '{$container['Name']}' is enabled - checking for update...");

if (!isset($allInfo)) {
ABHelper::backupLog("Requesting docker template meta...", ABHelper::LOGLEVEL_DEBUG);
$dockerTemplates = new \DockerTemplates();
$allInfo = $dockerTemplates->getAllInfo(true, true);
ABHelper::backupLog(print_r($allInfo, true), ABHelper::LOGLEVEL_DEBUG);
ABHelper::backupLog(var_export($allInfo, true), ABHelper::LOGLEVEL_DEBUG);
}

if (isset($allInfo[$container['Name']]) && !$allInfo[$container['Name']]['updated']) {
ABHelper::backupLog("Update available! Installing...");
if (isset($allInfo[$container['Name']]) && ($allInfo[$container['Name']]['updated'] ?? 'true') == 'false') { # string 'false' = Update available!
ABHelper::backupLog("Auto-Update for '{$container['Name']}' is enabled and update is available!! Installing...");
exec('/usr/local/emhttp/plugins/dynamix.docker.manager/scripts/update_container ' . escapeshellarg($container['Name']));
ABHelper::backupLog("Update finished (hopefully).");
} else {
ABHelper::backupLog("No update available.");
ABHelper::backupLog("Auto-Update for '{$container['Name']}' is enabled but no update is available.");
}
}
if (ABHelper::abortRequested()) {
goto abort;
}
}
ABHelper::backupLog("Docker update check finished!");


if (!empty($abSettings->includeFiles)) {
Expand Down

0 comments on commit 24310fa

Please sign in to comment.