1 Commits
v2.0.1 ... main

Author SHA1 Message Date
dichgrem
45b2ee62d7 fix:actions 2026-01-23 12:43:26 +08:00

View File

@@ -106,11 +106,17 @@ auto_start = s:option(Flag, "auto_start", "启用定时启动")
auto_start.description = "启用后将在每周一至周五自动启动服务" auto_start.description = "启用后将在每周一至周五自动启动服务"
auto_start.rmempty = false auto_start.rmempty = false
-- Get Status
auto_start.cfgvalue = function(self, section)
local has_cron = sys.call("crontab -l 2>/dev/null | grep 'S99zzz' >/dev/null") == 0
return has_cron and "1" or "0"
end
-- Schedule Time -- Schedule Time
schedule_time = s:option(Value, "schedule_time", "启动时间") schedule_time = s:option(Value, "schedule_time", "启动时间")
schedule_time.description = "设置定时启动的时间 (格式: HH:MM例如 07:30)" schedule_time.description = "设置定时启动的时间 (格式: HH:MM例如 07:30)"
schedule_time.placeholder = "07:00" schedule_time.placeholder = "07:00"
schedule_time.rmempty = true schedule_time.rmempty = false
schedule_time.default = "07:00" schedule_time.default = "07:00"
schedule_time.cfgvalue = function(self, section) schedule_time.cfgvalue = function(self, section)
@@ -135,12 +141,6 @@ end
schedule_time:depends("auto_start", "1") schedule_time:depends("auto_start", "1")
-- Get Status
auto_start.cfgvalue = function(self, section)
local has_cron = sys.call("crontab -l 2>/dev/null | grep 'S99zzz' >/dev/null") == 0
return has_cron and "1" or "0"
end
-- Crontab -- Crontab
auto_start.write = function(self, section, value) auto_start.write = function(self, section, value)
local schedule_time_val = self.map:get(section, "schedule_time") or "07:00" local schedule_time_val = self.map:get(section, "schedule_time") or "07:00"