Skip to content

Commit ce4d2d9

Browse files
author
Marius Burkard
committed
Merge branch '3.1.15p2-updates' into 'stable-3.1'
added update status check for Redhat based distros See merge request ispconfig/ispconfig3!935
2 parents ff920a3 + 8f06999 commit ce4d2d9

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

server/lib/classes/cron.d/100-monitor_system_update.inc.php

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,29 @@ public function onRunJob() {
159159
* Fetch the output
160160
*/
161161
$data['output'] = shell_exec('zypper lu');
162-
} else {
162+
} elseif(file_exists('/etc/redhat-release')) {
163+
/*
164+
* update and find the upgrade.
165+
* if there is any output, then there is a needed update
166+
*/
167+
$aptData = shell_exec('yum -q list updates');
168+
if ($aptData == '') {
169+
/* There is nothing to update! */
170+
$state = 'ok';
171+
} else {
172+
/*
173+
* There is something to update! this is in most cases not critical, so we can
174+
* do a system-update once a month or so...
175+
*/
176+
$state = 'info';
177+
}
178+
179+
/*
180+
* Fetch the output
181+
*/
182+
$data['output'] = shell_exec('yum -q list updates');
183+
184+
} else {
163185
/*
164186
* It is not Debian/Ubuntu, so there is no data and no state
165187
*

0 commit comments

Comments
 (0)