Skip to content

Commit

Permalink
Fix Docker autoupdate
Browse files Browse the repository at this point in the history
  • Loading branch information
Commifreak committed Aug 16, 2023
1 parent a720e87 commit ef94e8e
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/scripts/backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


if (ABHelper::scriptRunning()) {
ABHelper::notify("Still running", "There is something running already.");
ABHelper::notify("Appdata Backup", "Still running", "There is something running already.");
exit;
}

Expand Down Expand Up @@ -271,17 +271,15 @@
$containerSettings = $abSettings->getContainerSpecificSettings($container['Name']);
if ($containerSettings['updateContainer'] == 'yes') {
ABHelper::backupLog("Auto-Update for '{$container['Name']}' is enabled - checking for update...");
$dockerUpdate = new \DockerUpdate();
$dockerTemplates = new \DockerTemplates();
ABHelper::backupLog("downloadTemplates", ABHelper::LOGLEVEL_DEBUG);
$dockerTemplates->downloadTemplates();
ABHelper::backupLog("reloadUpdateStatus", ABHelper::LOGLEVEL_DEBUG);
$dockerUpdate->reloadUpdateStatus($container['Image']);
ABHelper::backupLog("getUpdateStatus", ABHelper::LOGLEVEL_DEBUG);
$updateStatus = $dockerUpdate->getUpdateStatus($container['Image']);
ABHelper::backupLog(print_r($updateStatus, true), ABHelper::LOGLEVEL_DEBUG);

if ($updateStatus === false) {

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);
}

if (isset($allInfo[$container['Name']]) && !$allInfo[$container['Name']]['updated']) {
ABHelper::backupLog("Update available! Installing...");
exec('/usr/local/emhttp/plugins/dynamix.docker.manager/scripts/update_container ' . escapeshellarg($container['Name']));
ABHelper::backupLog("Update finished (hopefully).");
Expand Down

0 comments on commit ef94e8e

Please sign in to comment.