Fixed daemonStatus API to return string returned by ZMC in addition to true/false so we can handle pending status of a monitor
This commit is contained in:
parent
d88a1cfb8b
commit
aa8f7da7e2
|
@ -158,11 +158,16 @@ class MonitorsController extends AppController {
|
||||||
$status = exec( $command );
|
$status = exec( $command );
|
||||||
|
|
||||||
// If 'not' is present, the daemon is not running, so return false
|
// If 'not' is present, the daemon is not running, so return false
|
||||||
|
// https://github.com/ZoneMinder/ZoneMinder/issues/799#issuecomment-108996075
|
||||||
|
// Also sending back the status text so we can check if the monitor is in pending
|
||||||
|
// state which means there may be an error
|
||||||
|
$statustext = $status;
|
||||||
$status = (strpos($status, 'not')) ? false : true;
|
$status = (strpos($status, 'not')) ? false : true;
|
||||||
|
|
||||||
$this->set(array(
|
$this->set(array(
|
||||||
'status' => $status,
|
'status' => $status,
|
||||||
'_serialize' => array('status')
|
'statustext' => $statustext,
|
||||||
|
'_serialize' => array('status','statustext'),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue