@@ -126,8 +126,7 @@ public function onRunJob() {
126126 * Check, if we have mpt-status installed (LSIsoftware-raid)
127127 */
128128 if (file_exists ('/proc/mpt/summary ' )) {
129- system ('which mpt-status ' , $ retval );
130- if ($ retval === 0 ) {
129+ if ($ app ->system ->is_installed ('mpt-status ' )) {
131130 /*
132131 * Fetch the output
133132 */
@@ -174,8 +173,7 @@ public function onRunJob() {
174173 /*
175174 * 3ware Controller
176175 */
177- system ('which tw_cli ' , $ retval );
178- if ($ retval === 0 ) {
176+ if ($ app ->system ->is_installed ('tw_cli ' )) {
179177
180178 // TYPOWORX FIX | Determine Controler-ID
181179 $ availableControlers = shell_exec ('tw_cli info | grep -Eo "c[0-9]+" ' );
@@ -232,8 +230,7 @@ public function onRunJob() {
232230 /*
233231 * HP Proliant
234232 */
235- system ('which hpacucli ' , $ retval );
236- if ($ retval === 0 ) {
233+ if ($ app ->system ->is_installed ('hpacucli ' )) {
237234 $ state = 'ok ' ;
238235 $ data ['output ' ] = shell_exec ('/usr/sbin/hpacucli ctrl all show config ' );
239236 $ tmp = explode ("\n" , $ data ['output ' ]);
@@ -278,10 +275,14 @@ public function onRunJob() {
278275 /*
279276 * LSI MegaRaid
280277 */
281- system ('which megacli ' , $ retval );
282- system ('which megacli64 ' , $ retval64 );
283- if ($ retval === 0 || $ retval64 === 0 ) {
284- $ binary =@($ retval === 0 )?'megacli ' :'megacli64 ' ;
278+ $ binary = FALSE ;
279+ if ($ app ->system ->is_installed ('megacli ' )) {
280+ $ binary = 'megacli ' ;
281+ }
282+ if ($ app ->system ->is_installed ('megacli64 ' )) {
283+ $ binary = 'megacli64 ' ;
284+ }
285+ if ($ binary ) {
285286 $ state = 'ok ' ;
286287 $ data ['output ' ] = shell_exec ($ binary .' -LDInfo -Lall -aAll -NoLog ' );
287288 if (strpos ($ data ['output ' ], 'Optimal ' ) !== false ) {
@@ -298,8 +299,7 @@ public function onRunJob() {
298299 /*
299300 * Adaptec-RAID
300301 */
301- system ('which arcconf ' , $ retval );
302- if ($ retval === 0 ) {
302+ if ($ app ->system ->is_installed ('arcconf ' )) {
303303 $ state = 'ok ' ;
304304 $ data ['output ' ] = shell_exec ('arcconf GETCONFIG 1 LD ' );
305305 if (is_array ($ data ['output ' ])) {
0 commit comments