char *config_buf;
char *script_name;
bool init_available;
+ bool no_proto_task;
struct uci_blob_param_list config;
};
if (task == &state->proto_task)
proto_shell_handler(&state->proto, PROTO_CMD_TEARDOWN,
false);
- if (task == &state->script_task) {
+ else if (task == &state->script_task) {
if (state->renew_pending)
proto_shell_handler(&state->proto,
PROTO_CMD_RENEW, false);
- else if (!state->proto_task.uloop.pending &&
+ else if (!state->handler->no_proto_task &&
+ !state->proto_task.uloop.pending &&
state->sm == S_SETUP)
proto_shell_handler(&state->proto,
PROTO_CMD_TEARDOWN,
if (tmp && json_object_get_boolean(tmp))
handler->proto.flags |= PROTO_FLAG_NODEV;
+ tmp = json_get_field(obj, "no-proto-task", json_type_boolean);
+ if (tmp && json_object_get_boolean(tmp))
+ handler->no_proto_task = true;
+ else
+ handler->no_proto_task = false;
+
tmp = json_get_field(obj, "available", json_type_boolean);
if (tmp && json_object_get_boolean(tmp))
handler->proto.flags |= PROTO_FLAG_INIT_AVAILABLE;
dump)
add_protocol() {
no_device=0
+ no_proto_task=0
available=0
renew_handler=0
eval "proto_$1_init_config"
json_close_array
json_add_boolean no-device "$no_device"
+ json_add_boolean no-proto-task "$no_proto_task"
json_add_boolean available "$available"
json_add_boolean renew-handler "$renew_handler"
json_add_boolean lasterror "$lasterror"