small-package/luci-app-poweroffdevice/luasrc/controller/poweroffdevice.lua

14 lines
341 B
Lua

module("luci.controller.poweroffdevice", package.seeall)
function index()
entry({"admin","system","poweroffdevice"},template("poweroffdevice/poweroffdevice"), _("PowerOff"), 92)
entry({"admin","system","poweroffdevice","call"},post("action_poweroff"))
end
function action_poweroff()
luci.sys.exec("/sbin/poweroff" )
end