Skip to content
Snippets Groups Projects
Commit 07bd3442 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fallback to the "first node" configuration

If a node's configuration can't be loaded (e.g. nodeX/node.cnf is missing), fall-back and load the "first node" (e.g. Node1) configuration. On recent *nix installs (since the migration to Git), the node2+/node.cnf files were not copied/created, so let's solve that soon-to-be-FAQ now.
parent 827063bb
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -5715,10 +5715,12 @@ NO_SSH: ...@@ -5715,10 +5715,12 @@ NO_SSH:
SAFECOPY(cfg->ctrl_dir, startup->ctrl_dir); SAFECOPY(cfg->ctrl_dir, startup->ctrl_dir);
lprintf(LOG_INFO,"Node %d Loading configuration files from %s", cfg->node_num, cfg->ctrl_dir); lprintf(LOG_INFO,"Node %d Loading configuration files from %s", cfg->node_num, cfg->ctrl_dir);
SAFECOPY(logstr,UNKNOWN_LOAD_ERROR); SAFECOPY(logstr,UNKNOWN_LOAD_ERROR);
if(!load_cfg(cfg, node_text[i - 1], TRUE, logstr)) {
cfg->node_num = first_node;
if(!load_cfg(cfg, node_text[i - 1], TRUE, logstr)) { if(!load_cfg(cfg, node_text[i - 1], TRUE, logstr)) {
lprintf(LOG_CRIT,"!ERROR %s",logstr); lprintf(LOG_CRIT,"!ERROR %s",logstr);
lprintf(LOG_CRIT,"!FAILED to load configuration files"); lprintf(LOG_CRIT,"!FAILED to load configuration files");
sbbs->bprintf(" FAILED: %s", logstr); sbbs->bprintf("\r\nFAILED: %s", logstr);
client_off(client_socket); client_off(client_socket);
SSH_END(client_socket); SSH_END(client_socket);
close_socket(client_socket); close_socket(client_socket);
...@@ -5727,6 +5729,8 @@ NO_SSH: ...@@ -5727,6 +5729,8 @@ NO_SSH:
sbbs->putnodedat(cfg->node_num,&node); sbbs->putnodedat(cfg->node_num,&node);
continue; continue;
} }
cfg->node_num = i; // correct the node number
}
if(node.misc & NODE_RRUN) { if(node.misc & NODE_RRUN) {
sbbs->getnodedat(cfg->node_num,&node,true); sbbs->getnodedat(cfg->node_num,&node,true);
node.misc &= ~NODE_RRUN; node.misc &= ~NODE_RRUN;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment