diff --git a/main.c b/main.c index dc14ac7..468dc8c 100644 --- a/main.c +++ b/main.c @@ -914,6 +914,7 @@ void server(int port) { int i; int on = 1; char str[INET6_ADDRSTRLEN]; + struct stat s; #if defined(ENABLE_WWW) www_daemon = NULL; #endif @@ -922,6 +923,16 @@ void server(int port) { printf("Magicka BBS Server Starting....\n"); } + for (i=1;i<=conf.nodes;i++) { + snprintf(buffer, 1024, "%s/nodeinuse.%d", conf.bbs_path, i); + if (stat(buffer, &s) == 0) { + if (!conf.fork) { + printf(" - Removing stale file: nodeinuse.%d\n", i); + } + unlink(buffer); + } + } + if (conf.ipguard_enable) { ip_guard_map = hashmap_new();