luci-base: add reboot rpc call

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2019-10-07 10:51:04 +02:00
parent 29ccea14f1
commit 1d68853cce
2 changed files with 7 additions and 1 deletions

View file

@ -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
}
}

View file

@ -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": [ "*" ]