From 738f1ccdb667205b8dfcf5542bd21a7ff53599ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Thu, 18 Jan 2018 08:31:31 +0100 Subject: [PATCH] module template: need to check if it's running for custom commands --- src/templates/module/module.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/templates/module/module.cpp b/src/templates/module/module.cpp index cde02bc6be..0d886f258d 100644 --- a/src/templates/module/module.cpp +++ b/src/templates/module/module.cpp @@ -83,6 +83,11 @@ int Module::print_status() int Module::custom_command(int argc, char *argv[]) { /* + if (!is_running()) { + print_usage("not running"); + return 1; + } + // additional custom commands can be handled like this: if (!strcmp(argv[0], "do-something")) { get_instance()->do_something();