mirror of
https://github.com/RaspAP/raspap-webgui.git
synced 2024-11-25 00:50:29 +00:00
Restart restapi.sevice on API key save
This commit is contained in:
parent
8d6b8174d1
commit
d1be0caf54
1 changed files with 4 additions and 1 deletions
|
@ -26,6 +26,10 @@ function DisplayRestAPI()
|
|||
$status->addMessage('Please enter a valid API key', 'danger');
|
||||
} else {
|
||||
$return = saveAPISettings($status, $apiKey, $dotenv);
|
||||
$status->addMessage('Restarting restapi.service', 'info');
|
||||
exec('sudo /bin/systemctl stop restapi.service', $return);
|
||||
sleep(1);
|
||||
exec('sudo /bin/systemctl start restapi.service', $return);
|
||||
}
|
||||
}
|
||||
} elseif (isset($_POST['StartRestAPIservice'])) {
|
||||
|
@ -75,7 +79,6 @@ function saveAPISettings($status, $apiKey, $dotenv)
|
|||
{
|
||||
$status->addMessage('Saving API key', 'info');
|
||||
$dotenv->set('RASPAP_API_KEY', $apiKey);
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue