Skip to content

Commit fe4fd73

Browse files
committed
fixed package manager detection in monitor_system_update.inc.php
1 parent f518b85 commit fe4fd73

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ public function onRunJob() {
159159
* Fetch the output
160160
*/
161161
$data['output'] = shell_exec('zypper lu');
162+
162163
} elseif(file_exists('/etc/redhat-release')) {
163164
/*
164165
* update and find the upgrade.
@@ -168,13 +169,14 @@ public function onRunJob() {
168169
/* try to figure out the default package manager first */
169170
if(file_exists('/usr/bin/dnf') && (is_link('/usr/bin/yum'))) {
170171
$rhPkgMgr = 'dnf';
171-
} elseif(file_exists('/usr/bin/dnf') && (!file_exists('/usr/bin/yum')) || (!is_link('/usr/bin/yum'))) {
172+
} elseif(file_exists('/usr/bin/dnf') && (!file_exists('/usr/bin/yum'))) {
172173
$rhPkgMgr = 'dnf';
173174
} else {
174175
$rhPkgMgr = 'yum';
175176
}
176177

177-
$aptData = shell_exec($rhPkgMgr. ' -q list updates');
178+
$aptData = shell_exec($rhPkgMgr. ' -q list updates');
179+
178180
if ($aptData == '') {
179181
/* There is nothing to update! */
180182
$state = 'ok';
@@ -188,7 +190,8 @@ public function onRunJob() {
188190

189191
/*
190192
* Fetch the output
191-
*/
193+
*/
194+
192195
$data['output'] = shell_exec($rhPkgMgr. ' -q list updates');
193196

194197
} else {

0 commit comments

Comments
 (0)