File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
server/lib/classes/cron.d Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff 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 *
You can’t perform that action at this time.
0 commit comments