mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 16:44:39 +00:00
firmware: API glue for reboot / powerdown; closes #948
This commit is contained in:
parent
a96b0da4c0
commit
38efa570cc
@ -114,6 +114,44 @@ class FirmwareController extends ApiControllerBase
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* perform reboot
|
||||
* @return array status
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function rebootAction()
|
||||
{
|
||||
$backend = new Backend();
|
||||
$response = array();
|
||||
if ($this->request->isPost()) {
|
||||
$response['status'] = 'ok';
|
||||
$response['msg_uuid'] = trim($backend->configdRun('firmware reboot', true));
|
||||
} else {
|
||||
$response['status'] = 'failure';
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* perform powerdown
|
||||
* @return array status
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function powerdownAction()
|
||||
{
|
||||
$backend = new Backend();
|
||||
$response = array();
|
||||
if ($this->request->isPost()) {
|
||||
$response['status'] = 'ok';
|
||||
$response['msg_uuid'] = trim($backend->configdRun('firmware powerdown', true));
|
||||
} else {
|
||||
$response['status'] = 'failure';
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* perform actual upgrade
|
||||
* @return array status
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user