LUCI system reboot 范例分析

系统重启:

\lua\luci\controller\admin\system.lua

entry({"admin", "system", "reboot"}, call("action_reboot"), _("Reboot"), 90)

直接调用action_reboot接口:

 

function action_reboot()
local reboot = luci.http.formvalue("reboot")
luci.template.render("admin_system/reboot", {reboot=reboot})
if reboot then
luci.sys.reboot()
end
end

关键就在于luci.sys.reboot()啦

 

此接口参照

http://luci.subsignal.org/api/luci/modules/luci.sys.html#reboot

posted @ 2015-05-20 18:04  souroot  阅读(611)  评论(0编辑  收藏  举报