Skip to content
Snippets Groups Projects
Commit fe4fd73f authored by ms217's avatar ms217
Browse files

fixed package manager detection in monitor_system_update.inc.php

parent f518b852
No related branches found
No related tags found
No related merge requests found
......@@ -159,6 +159,7 @@ class cronjob_monitor_system_update extends cronjob {
* Fetch the output
*/
$data['output'] = shell_exec('zypper lu');
} elseif(file_exists('/etc/redhat-release')) {
/*
* update and find the upgrade.
......@@ -168,13 +169,14 @@ class cronjob_monitor_system_update extends cronjob {
/* try to figure out the default package manager first */
if(file_exists('/usr/bin/dnf') && (is_link('/usr/bin/yum'))) {
$rhPkgMgr = 'dnf';
} elseif(file_exists('/usr/bin/dnf') && (!file_exists('/usr/bin/yum')) || (!is_link('/usr/bin/yum'))) {
} elseif(file_exists('/usr/bin/dnf') && (!file_exists('/usr/bin/yum'))) {
$rhPkgMgr = 'dnf';
} else {
$rhPkgMgr = 'yum';
}
$aptData = shell_exec($rhPkgMgr. ' -q list updates');
$aptData = shell_exec($rhPkgMgr. ' -q list updates');
if ($aptData == '') {
/* There is nothing to update! */
$state = 'ok';
......@@ -188,7 +190,8 @@ class cronjob_monitor_system_update extends cronjob {
/*
* Fetch the output
*/
*/
$data['output'] = shell_exec($rhPkgMgr. ' -q list updates');
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment