diff options
author | Rafał Miłecki <rafal@milecki.pl> | 2020-06-23 20:46:19 +0200 |
---|---|---|
committer | Rafał Miłecki <rafal@milecki.pl> | 2020-09-10 13:18:09 +0200 |
commit | 646daa0bec742e4c0af010ca85eda9021d95e4cf (patch) | |
tree | 240bfff1bfc0737d0e7a1d709ad609c82be61e46 /include | |
parent | 078bb57e0769c987c05244abe1f7d8d53e0e323e (diff) | |
download | rpcd-646daa0bec742e4c0af010ca85eda9021d95e4cf.tar.gz |
rc: new ubus object for handling /etc/init.d/ scripts
This commit adds "rc" ubus object with methods "list" and "exec" for
listing and calling init.d script appropriately. It's useful for all
kind of UIs (e.g. LuCI) and custom apps.
Example:
root@OpenWrt:~# ubus call rc list
{
"blockd": {
"start": 80,
"enabled": true,
"running": true
},
"dnsmasq": {
"start": 19,
"enabled": true,
"running": true
}
}
root@OpenWrt:~# ubus call rc init '{ "name": "blockd", "action": "disable" }'
root@OpenWrt:~# ubus call rc init '{ "name": "dnsmasq", "action": "stop" }'
root@OpenWrt:~# ubus call rc list
{
"blockd": {
"start": 80,
"enabled": false,
"running": true
},
"dnsmasq": {
"start": 19,
"enabled": true,
"running": false
}
}
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'include')
-rw-r--r-- | include/rpcd/rc.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/rpcd/rc.h b/include/rpcd/rc.h new file mode 100644 index 0000000..ca00f56 --- /dev/null +++ b/include/rpcd/rc.h @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: ISC OR MIT +#ifndef __RPCD_RC_H +#define __RPCD_RC_H + +int rpc_rc_api_init(struct ubus_context *ctx); + +#endif |