fix: all the bugs with the new database and commanding

This commit is contained in:
Tobias Reisinger 2020-08-24 23:44:49 +02:00
parent 9602e6e937
commit 924633f272
12 changed files with 99 additions and 149 deletions

View file

@ -122,7 +122,6 @@ main(int argc, const char** argv)
if(!global_controller)
{
global_controller = controller_create();
controller_save();
}
@ -130,9 +129,13 @@ main(int argc, const char** argv)
connection_mqtt_connect(&mgr);
struct mg_connection *c_command = connection_command_bind(&mgr);
global_controller->command_port = helper_get_port(c_command->sock);
if(global_controller->command_port == 0)
{
global_controller->command_port = helper_get_port(c_command->sock);
controller_save();
}
controller_save();
controller_debug(global_controller);
helper_drop_privileges();