summaryrefslogtreecommitdiffstats
path: root/modules-available/systemstatus/hooks/main-warning.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/systemstatus/hooks/main-warning.inc.php')
-rw-r--r--modules-available/systemstatus/hooks/main-warning.inc.php18
1 files changed, 14 insertions, 4 deletions
diff --git a/modules-available/systemstatus/hooks/main-warning.inc.php b/modules-available/systemstatus/hooks/main-warning.inc.php
index 5707c7d2..6b0ac981 100644
--- a/modules-available/systemstatus/hooks/main-warning.inc.php
+++ b/modules-available/systemstatus/hooks/main-warning.inc.php
@@ -1,9 +1,19 @@
<?php
-if (file_exists('/run/reboot-required.pkgs')) {
- $lines = file('/run/reboot-required.pkgs', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
- $lines = array_unique($lines);
- Message::addInfo('systemstatus.update-reboot-required', true, implode(', ', $lines));
+$cnt = SystemStatus::getUpgradableSecurityCount();
+if ($cnt > 0) {
+ Message::addWarning('systemstatus.security-updates-available', true, $cnt);
+}
+
+$pkgs = SystemStatus::getPackagesRequiringReboot();
+if (!empty($pkgs)) {
+ Message::addInfo('systemstatus.update-reboot-required', true, implode(', ', $pkgs));
+}
+
+$aptTs = SystemStatus::getAptLastDbUpdateTime();
+if ($aptTs + 864000 < time()) {
+ // No update for 10 days
+ Message::addWarning('systemstatus.apt-db-out-of-date', true, Util::prettyTime($aptTs));
}
if (SystemStatus::diskStat($systemUsage, $storeUsage, $current, $wanted)) {