Load host specific settings from configuration file

This commit is contained in:
Iwan Timmer 2015-08-03 19:42:42 +02:00
parent 7a200fea64
commit d3c3ba92c7
2 changed files with 5 additions and 1 deletions

View File

@ -266,7 +266,7 @@ void config_parse(int argc, char* argv[], PCONFIGURATION config) {
char* config_file = get_path("moonlight.conf", "/etc");
if (config_file)
config_file_parse(config_file, config);
if (argc == 2 && access(argv[1], F_OK) == 0) {
config->action = "stream";
config_file_parse(argv[1], config);

View File

@ -177,6 +177,10 @@ int main(int argc, char* argv[]) {
exit(-1);
}
}
char host_config_file[128];
sprintf(host_config_file, "hosts/%s.conf", config.address);
config_file_parse(host_config_file, &config);
PSERVER_DATA server;
if (gs_init(server, config.address, config.key_dir) != GS_OK) {