mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 14:36:52 +00:00
add sendnotifications and update checker cron
Signed-off-by: szaimen <szaimen@e.mail.de> Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
parent
c8e8c27925
commit
a46a36ee41
4 changed files with 77 additions and 1 deletions
30
php/src/Cron/cron.php
Normal file
30
php/src/Cron/cron.php
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
// increase memory limit to 2GB
|
||||
ini_set('memory_limit', '2048M');
|
||||
|
||||
use DI\Container;
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$container = \AIO\DependencyInjection::GetContainer();
|
||||
|
||||
/** @var \AIO\Docker\DockerActionManager $dockerActionManger */
|
||||
$dockerActionManger = $container->get(\AIO\Docker\DockerActionManager::class);
|
||||
/** @var \AIO\ContainerDefinitionFetcher $containerDefinitionFetcher */
|
||||
$containerDefinitionFetcher = $container->get(\AIO\ContainerDefinitionFetcher::class);
|
||||
|
||||
$id = 'nextcloud-aio-nextcloud';
|
||||
$nextcloudContainer = $containerDefinitionFetcher->GetContainerById($id);
|
||||
|
||||
$isMastercontainerUpdateAvailable = $dockerActionManger->IsMastercontainerUpdateAvailable();
|
||||
$isAnyUpdateAvailable = $dockerActionManger->isAnyUpdateAvailable();
|
||||
|
||||
if ($isMastercontainerUpdateAvailable === true) {
|
||||
$dockerActionManger->sendNotification($nextcloudContainer, 'Mastercontainer update available!', 'Please open your management interface to update it.');
|
||||
}
|
||||
|
||||
if ($isAnyUpdateAvailable === true) {
|
||||
$dockerActionManger->sendNotification($nextcloudContainer, 'Container updates available!', 'Please open your management interface to update them.');
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue