summaryrefslogtreecommitdiff
path: root/proto-shell.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-10-27 21:09:47 +0200
committerFelix Fietkau <nbd@openwrt.org>2011-10-27 21:09:47 +0200
commit24ccfe7d353ceb0ee4f8d4967604585de92fc9d0 (patch)
treedf587c64fb54681c1fb563104134e06f0e751d28 /proto-shell.c
parent301cf1c6f2c2b155c476e1fb861eeaa19c533222 (diff)
downloadnetifd-24ccfe7d353ceb0ee4f8d4967604585de92fc9d0.tar.gz
proto-shell: handle the "available" config flag
Diffstat (limited to 'proto-shell.c')
-rw-r--r--proto-shell.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/proto-shell.c b/proto-shell.c
index b40b456..51a6dac 100644
--- a/proto-shell.c
+++ b/proto-shell.c
@@ -25,6 +25,7 @@ struct proto_shell_handler {
struct proto_handler proto;
struct config_param_list config;
char *config_buf;
+ bool init_available;
char script_name[];
};
@@ -615,6 +616,10 @@ proto_shell_add_handler(const char *script, json_object *obj)
if (tmp && json_object_get_boolean(tmp))
handler->proto.flags |= PROTO_FLAG_NODEV;
+ tmp = get_field(obj, "available", json_type_boolean);
+ if (tmp && json_object_get_boolean(tmp))
+ handler->proto.flags |= PROTO_FLAG_INIT_AVAILABLE;
+
config = get_field(obj, "config", json_type_array);
if (config)
handler->config_buf = proto_shell_parse_config(&handler->config, config);