首页 > 技术文章 > LUCI system reboot 范例分析

souroot 2015-05-20 18:04 原文

系统重启:

\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

推荐阅读