diff --git a/.gitignore b/.gitignore index 3a351c2..911395d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ # Castorsrm config.json +build/ # Logs diff --git a/src/index.ts b/src/index.ts index 0f58979..1803bf9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -20,6 +20,12 @@ if (fs.existsSync("config.json")) { // Write the new config file in case we updated something. await fs.promises.writeFile("config.json", config.toJSON()); +// Validate configuration +if (config.proxy.count < 1) { + logger.error("Proxy count must be greater than 0."); + process.exit(1); +} + logger.level = process.env.LOG_LEVEL || config.logger.level; logger.info(`Logger level set to '${logger.level}'`);