File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -159,6 +159,18 @@ public function onRunJob() {
159159 * Fetch the output
160160 */
161161 $ data ['output ' ] = shell_exec ('zypper lu ' );
162+ } else if (file_exists ('/etc/redhat-release ' )) {
163+
164+ if (shell_exec ("yum list updates | awk 'p; /Updated Packages/ {p=1}' " ) == '' ) {
165+ // There is nothing to update
166+ $ state = 'ok ' ;
167+ }
168+ else {
169+ $ state = 'info ' ;
170+ }
171+ // Fetch the output
172+ $ yumData = shell_exec ('yum check-update ' );
173+ $ data ['output ' ] = $ yumData ;
162174 } else {
163175 /*
164176 * It is not Debian/Ubuntu, so there is no data and no state
Original file line number Diff line number Diff line change @@ -265,23 +265,23 @@ function get_distname() {
265265 $ distbaseid = 'fedora ' ;
266266 } elseif (stristr ($ content , 'CentOS release 5 ' )) {
267267 $ distname = 'CentOS ' ;
268- $ distver = 'Unknown ' ;
268+ $ distver = '5 ' ;
269269 $ distid = 'centos53 ' ;
270270 $ distbaseid = 'fedora ' ;
271271 } elseif (stristr ($ content , 'CentOS Linux release 6 ' )) {
272272 $ distname = 'CentOS ' ;
273- $ distver = 'Unknown ' ;
273+ $ distver = '6 ' ;
274274 $ distid = 'centos53 ' ;
275275 $ distbaseid = 'fedora ' ;
276276 } elseif (stristr ($ content , 'CentOS Linux release 7.2 ' )) {
277277 $ distname = 'CentOS ' ;
278- $ distver = 'Unknown ' ;
278+ $ distver = '7.2 ' ;
279279 $ distid = 'centos70 ' ;
280280 $ distconfid = 'centos72 ' ;
281281 $ distbaseid = 'fedora ' ;
282282 } elseif (stristr ($ content , 'CentOS Linux release 7 ' )) {
283283 $ distname = 'CentOS ' ;
284- $ distver = 'Unknown ' ;
284+ $ distver = '7 ' ;
285285 $ distid = 'centos70 ' ;
286286 $ distbaseid = 'fedora ' ;
287287 } else {
You can’t perform that action at this time.
0 commit comments