mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2026-02-21 11:52:42 +01:00
Added dm_entry_manage_services API
This commit is contained in:
parent
332efcbf55
commit
f347d9d011
2 changed files with 22 additions and 0 deletions
21
dmentry.c
21
dmentry.c
|
|
@ -338,6 +338,27 @@ int adm_entry_get_linker_value(struct dmctx *ctx, char *param, char **value)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int dm_entry_manage_services(struct blob_buf *bb, bool restart)
|
||||
{
|
||||
struct package_change *pc = NULL;
|
||||
void *arr;
|
||||
|
||||
if (!bb)
|
||||
return 0;
|
||||
|
||||
arr = blobmsg_open_array(bb, "updated_services");
|
||||
list_for_each_entry(pc, &head_package_change, list) {
|
||||
blobmsg_add_string(bb, NULL, pc->package);
|
||||
if (restart) {
|
||||
dmubus_call_set("uci", "commit", UBUS_ARGS{{"config", pc->package, String}}, 1);
|
||||
} else {
|
||||
dmuci_commit_package(pc->package);
|
||||
}
|
||||
}
|
||||
blobmsg_close_array(bb, arr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dm_entry_restart_services(void)
|
||||
{
|
||||
struct package_change *pc = NULL;
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ int dm_ctx_init_sub(struct dmctx *ctx, unsigned int instance_mode);
|
|||
int dm_entry_param_method(struct dmctx *ctx, int cmd, char *inparam, char *arg1, char *arg2);
|
||||
int dm_entry_apply(struct dmctx *ctx, int cmd, char *arg1, char *arg2);
|
||||
int dm_entry_restart_services(void);
|
||||
int dm_entry_manage_services(struct blob_buf *bb, bool restart);
|
||||
int dm_entry_revert_changes(void);
|
||||
int usp_fault_map(int fault);
|
||||
int dm_ctx_clean(struct dmctx *ctx);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue