Fixed SYSTEM_START trigger ignoring return value

This commit is contained in:
Thulinma 2019-02-28 11:27:47 +01:00
parent 132aea4536
commit f38c838cfd
2 changed files with 5 additions and 1 deletions

View file

@ -302,6 +302,7 @@ int main_loop(int argc, char **argv){
Controller::prometheus = Controller::Storage["config"]["prometheus"].asStringRef();
Controller::accesslog = Controller::Storage["config"]["accesslog"].asStringRef();
Controller::writeConfig();
if (!Controller::conf.is_active){return 0;}
Controller::checkAvailProtocols();
Controller::checkAvailTriggers();
Controller::writeCapabilities();

View file

@ -422,7 +422,10 @@ namespace Controller{
static bool serverStartTriggered;
if (!serverStartTriggered){
if (!Triggers::doTrigger("SYSTEM_START")){conf.is_active = false;}
if (!Triggers::doTrigger("SYSTEM_START")){
INFO_MSG("Shutting down because of SYSTEM_START trigger response");
conf.is_active = false;
}
serverStartTriggered = true;
}
/*LTS-END*/