From: Jo-Philipp Wich Date: Mon, 7 Oct 2019 08:51:04 +0000 (+0200) Subject: luci-base: add reboot rpc call X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1d68853ccec6a04ffe180263d0b1367e824c091f;p=oweals%2Fluci.git luci-base: add reboot rpc call Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-base/root/usr/libexec/rpcd/luci b/modules/luci-base/root/usr/libexec/rpcd/luci index 8215fb95d..ace0957f3 100755 --- a/modules/luci-base/root/usr/libexec/rpcd/luci +++ b/modules/luci-base/root/usr/libexec/rpcd/luci @@ -685,6 +685,12 @@ local methods = { local util = require "luci.util" return { result = (os.execute(string.format("/bin/umount %s", util.shellquote(args.path))) == 0) } end + }, + + setReboot = { + call = function() + return { result = (os.execute("/sbin/reboot >/dev/null 2>&1") == 0) } + end } } diff --git a/modules/luci-base/root/usr/share/rpcd/acl.d/luci-base.json b/modules/luci-base/root/usr/share/rpcd/acl.d/luci-base.json index 54caa7436..001e6deec 100644 --- a/modules/luci-base/root/usr/share/rpcd/acl.d/luci-base.json +++ b/modules/luci-base/root/usr/share/rpcd/acl.d/luci-base.json @@ -67,7 +67,7 @@ "ubus": { "file": [ "write", "remove", "exec" ], "iwinfo": [ "scan" ], - "luci": [ "setInitAction", "setLocaltime", "setPassword", "setBlockDetect", "setUmount" ], + "luci": [ "setInitAction", "setLocaltime", "setPassword", "setBlockDetect", "setUmount", "setReboot" ], "uci": [ "add", "apply", "confirm", "delete", "order", "set", "rename" ] }, "uci": [ "*" ]