mirror of
https://github.com/Dichgrem/luci-app-nyn.git
synced 2026-02-05 03:01:56 -05:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
45b2ee62d7 |
1
.github/workflows/build-zzz.yml
vendored
1
.github/workflows/build-zzz.yml
vendored
@@ -124,6 +124,7 @@ jobs:
|
||||
set -euo pipefail
|
||||
cd "$SDK_ROOT"
|
||||
echo "添加 zzz feed"
|
||||
sed -i '/^src-git zzz/d' feeds.conf.default 2>/dev/null || true
|
||||
echo "src-git zzz https://github.com/Dichgrem/luci-app-zzz.git" >> feeds.conf.default
|
||||
echo "更新 feeds"
|
||||
./scripts/feeds update -a
|
||||
|
||||
@@ -106,11 +106,17 @@ auto_start = s:option(Flag, "auto_start", "启用定时启动")
|
||||
auto_start.description = "启用后将在每周一至周五自动启动服务"
|
||||
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 = s:option(Value, "schedule_time", "启动时间")
|
||||
schedule_time.description = "设置定时启动的时间 (格式: HH:MM,例如 07:30)"
|
||||
schedule_time.placeholder = "07:00"
|
||||
schedule_time.rmempty = true
|
||||
schedule_time.rmempty = false
|
||||
schedule_time.default = "07:00"
|
||||
|
||||
schedule_time.cfgvalue = function(self, section)
|
||||
@@ -135,12 +141,6 @@ end
|
||||
|
||||
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
|
||||
auto_start.write = function(self, section, value)
|
||||
local schedule_time_val = self.map:get(section, "schedule_time") or "07:00"
|
||||
|
||||
Reference in New Issue
Block a user