add back daemon parameter, but make it actually work

This commit is contained in:
Isaac Connor 2018-11-14 12:59:44 -05:00
parent 9d8f0fef0c
commit 51d8c0ea73
1 changed files with 8 additions and 5 deletions

View File

@ -352,8 +352,7 @@ class MonitorsController extends AppController {
)); ));
} }
public function daemonControl($id, $command) { public function daemonControl($id, $command, $daemon=null) {
$daemons = array();
// Need to see if it is local or remote // Need to see if it is local or remote
$monitor = $this->Monitor->find('first', array( $monitor = $this->Monitor->find('first', array(
@ -362,11 +361,15 @@ class MonitorsController extends AppController {
)); ));
$monitor = $monitor['Monitor']; $monitor = $monitor['Monitor'];
if ( ! $daemon ) {
if ( $monitor['Function'] == 'Monitor' ) { if ( $monitor['Function'] == 'Monitor' ) {
array_push($daemons, 'zmc'); array_push($daemons, 'zmc');
} else { } else {
array_push($daemons, 'zmc', 'zma'); array_push($daemons, 'zmc', 'zma');
} }
} else {
array_push($daemons, $daemon);
}
$zm_path_bin = Configure::read('ZM_PATH_BIN'); $zm_path_bin = Configure::read('ZM_PATH_BIN');