Merge pull request #876 from pliablepixels/799-api-improvements

Fixed daemonStatus API to return string returned by ZMC in addition t…
This commit is contained in:
Isaac Connor 2015-06-08 11:02:54 -04:00
commit 45c3651ebb
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'),
));
}