summaryrefslogtreecommitdiffhomepage
path: root/proto-shell.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-09-11 12:35:21 +0200
committerFelix Fietkau <nbd@openwrt.org>2011-09-11 12:35:35 +0200
commit7f081660bf24fed49a716022a6ea17bb1dcde73a (patch)
treeb64c2a4926b2e6370c53117f85dac0727e2bbf39 /proto-shell.c
parentf505119b07b89ad23f4264e77b0bf0f0c0400399 (diff)
proto-shell: add a config option for setting PROTO_FLAG_NODEV
Diffstat (limited to 'proto-shell.c')
-rw-r--r--proto-shell.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/proto-shell.c b/proto-shell.c
index d014b43..8612631 100644
--- a/proto-shell.c
+++ b/proto-shell.c
@@ -230,6 +230,10 @@ proto_shell_add_handler(const char *script, json_object *obj)
proto->config_params = &handler->config;
proto->attach = proto_shell_attach;
+ tmp = get_field(obj, "no-device", json_type_boolean);
+ if (tmp && json_object_get_boolean(tmp))
+ handler->proto.flags |= PROTO_FLAG_NODEV;
+
config = get_field(obj, "config", json_type_array);
if (config)
handler->config_buf = proto_shell_parse_config(&handler->config, config);