From 6057bbf9e852103c252bf3429146c5c1309bbc4a Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Wed, 1 Jul 2020 19:44:19 +0200 Subject: Improve the lint command further --- minecctl/rcon-commands.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'minecctl/rcon-commands.c') diff --git a/minecctl/rcon-commands.c b/minecctl/rcon-commands.c index fc5b932..dfe8647 100644 --- a/minecctl/rcon-commands.c +++ b/minecctl/rcon-commands.c @@ -371,13 +371,23 @@ bool do_stop(struct cfg *cfg) bool do_stop_all(struct cfg *cfg) { struct server *server; + unsigned lineno; + const char *error; + bool rv = true; list_for_each_entry(server, &cfg->servers, list) { - server_read_config(cfg, server); + if (!server_read_config(cfg, server, &lineno, &error)) { + info("• %s: %sfail%s - invalid configuration file " + "(line %u: %s)", + server->name, ansi_red, ansi_normal, + lineno, error); + rv = false; + } + /* FIXME: error checks */ stop_one_server(cfg, server); } - return true; + return rv; } bool do_rcon_pcount(struct cfg *cfg, unsigned *online, unsigned *max) -- cgit v1.2.3