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:
Pliable Pixels 2015-06-08 14:35:45 +00:00
parent d88a1cfb8b
commit aa8f7da7e2
1 changed files with 6 additions and 1 deletions

View File

@ -158,11 +158,16 @@ class MonitorsController extends AppController {
$status = exec( $command );
// 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;
$this->set(array(
'status' => $status,
'_serialize' => array('status')
'statustext' => $statustext,
'_serialize' => array('status','statustext'),
));
}