json_script: add support for aborting script processing
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
This commit is contained in:
parent
136a519626
commit
3d45c47752
2 changed files with 18 additions and 0 deletions
|
@ -541,6 +541,9 @@ static int json_process_cmd(struct json_call *call, struct blob_attr *block)
|
|||
}
|
||||
|
||||
blobmsg_for_each_attr(cur, block, rem) {
|
||||
if (ctx->abort)
|
||||
break;
|
||||
|
||||
switch(blobmsg_type(cur)) {
|
||||
case BLOBMSG_TYPE_STRING:
|
||||
if (!i)
|
||||
|
@ -571,6 +574,8 @@ void json_script_run_file(struct json_script_ctx *ctx, struct json_script_file *
|
|||
if (!call.seq)
|
||||
call.seq = ++_seq;
|
||||
|
||||
ctx->abort = false;
|
||||
|
||||
__json_script_run(&call, file, NULL);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue