op-packages/luci-app-mac/luasrc/model/cbi/autoreboot.lua
github-actions[bot] 32600acc60 🌴 Sync 2026-03-05 23:51:42
2026-03-05 23:51:42 +08:00

31 lines
775 B
Lua

--[[
LuCI - Lua Configuration Interface
Copyright 2010 Jo-Philipp Wich <xm@subsignal.org>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
]]--
require("luci.sys")
m = Map("autoreboot", translate("定时重启"), translate("配置定时重启。"))
s = m:section(TypedSection, "login", "")
s.addremove = false
s.anonymous = true
enable = s:option(Flag, "enable", translate("启用"))
pass = s:option(Value, "minute", translate(""))
hour = s:option(Value, "hour", translate(""))
local apply = luci.http.formvalue("cbi.apply")
if apply then
io.popen("/etc/init.d/autoreboot restart")
end
return m