mirror of
https://github.com/Dichgrem/luci-app-nyn.git
synced 2025-12-16 13:42:00 -05:00
fix:use_musl
fix:arch_x86_64
This commit is contained in:
@@ -24,11 +24,11 @@ function service_control()
|
||||
if action then
|
||||
local cmd = ""
|
||||
if action == "start" then
|
||||
cmd = "/etc/rc.d/S99zzz start"
|
||||
cmd = "/etc/rc.d/zzz start"
|
||||
elseif action == "stop" then
|
||||
cmd = "/etc/rc.d/S99zzz stop"
|
||||
cmd = "/etc/rc.d/zzz stop"
|
||||
elseif action == "restart" then
|
||||
cmd = "/etc/rc.d/S99zzz stop && sleep 2 && /etc/rc.d/S99zzz start"
|
||||
cmd = "/etc/rc.d/zzz stop && sleep 2 && /etc/rc.d/zzz start"
|
||||
end
|
||||
|
||||
if cmd ~= "" then
|
||||
|
||||
@@ -8,11 +8,11 @@ local stop_action = luci.http.formvalue("cbid.zzz.auth.stop_service")
|
||||
local restart_action = luci.http.formvalue("cbid.zzz.auth.restart_service")
|
||||
|
||||
if start_action then
|
||||
sys.call("/etc/rc.d/S99zzz start")
|
||||
sys.call("/etc/rc.d/zzz start")
|
||||
elseif stop_action then
|
||||
sys.call("/etc/rc.d/S99zzz stop")
|
||||
sys.call("/etc/rc.d/zzz stop")
|
||||
elseif restart_action then
|
||||
sys.call("/etc/rc.d/S99zzz stop; sleep 2; /etc/rc.d/S99zzz start")
|
||||
sys.call("/etc/rc.d/zzz stop; sleep 2; /etc/rc.d/zzz start")
|
||||
end
|
||||
|
||||
m = Map("zzz", "zzz 802.1x 认证客户端",
|
||||
@@ -84,7 +84,7 @@ 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
|
||||
local has_cron = sys.call("crontab -l 2>/dev/null | grep 'zzz' >/dev/null") == 0
|
||||
return has_cron and "1" or "0"
|
||||
end
|
||||
|
||||
@@ -92,12 +92,12 @@ end
|
||||
auto_start.write = function(self, section, value)
|
||||
if value == "1" then
|
||||
-- 启用定时任务:每周一至周五 7:00 启动
|
||||
sys.call("(crontab -l 2>/dev/null | grep -v 'S99zzz' | grep -v '# zzz auto') | crontab - 2>/dev/null")
|
||||
sys.call("(crontab -l 2>/dev/null; echo '0 7 * * 1,2,3,4,5 /etc/rc.d/S99zzz start # zzz auto start') | crontab -")
|
||||
sys.call("(crontab -l 2>/dev/null | grep -v 'zzz' | grep -v '# zzz auto') | crontab - 2>/dev/null")
|
||||
sys.call("(crontab -l 2>/dev/null; echo '0 7 * * 1,2,3,4,5 /etc/rc.d/zzz start # zzz auto start') | crontab -")
|
||||
sys.call("/etc/init.d/cron enable && /etc/init.d/cron restart")
|
||||
else
|
||||
-- 禁用定时任务
|
||||
sys.call("(crontab -l 2>/dev/null | grep -v 'S99zzz' | grep -v '# zzz auto') | crontab - 2>/dev/null")
|
||||
sys.call("(crontab -l 2>/dev/null | grep -v 'zzz' | grep -v '# zzz auto') | crontab - 2>/dev/null")
|
||||
sys.call("/etc/init.d/cron restart")
|
||||
end
|
||||
end
|
||||
@@ -106,8 +106,8 @@ end
|
||||
timer_status_display = s:option(DummyValue, "_timer_status_display", "定时任务状态")
|
||||
timer_status_display.rawhtml = true
|
||||
timer_status_display.cfgvalue = function()
|
||||
local cron_output = sys.exec("crontab -l 2>/dev/null | grep 'S99zzz' || echo '未设置'")
|
||||
if cron_output:match("S99zzz") then
|
||||
local cron_output = sys.exec("crontab -l 2>/dev/null | grep 'zzz' || echo '未设置'")
|
||||
if cron_output:match("zzz") then
|
||||
return "<span style='color:green;font-weight:bold'>✔ 已启用 (每周一至周五 7:00 自动启动)</span>"
|
||||
else
|
||||
return "<span style='color:red;font-weight:bold'>✘ 未启用</span>"
|
||||
|
||||
16
zzz/Makefile
16
zzz/Makefile
@@ -14,7 +14,7 @@ define Package/zzz
|
||||
CATEGORY:=Network
|
||||
TITLE:=ZZZ 802.1x Authentication Client
|
||||
URL:=https://github.com/diredocks/zzz
|
||||
DEPENDS:=
|
||||
DEPENDS:=+libpcap
|
||||
endef
|
||||
|
||||
define Package/zzz/description
|
||||
@@ -43,17 +43,17 @@ define Package/zzz/install
|
||||
$(INSTALL_DIR) $(1)/etc/zzz
|
||||
|
||||
# Install precompiled binary based on architecture
|
||||
$(if $(CONFIG_TARGET_x86_64),$(INSTALL_BIN) ./files/bin/zzz-x86-linux-gnu $(1)/usr/bin/zzz)
|
||||
$(if $(CONFIG_TARGET_armvirt_64),$(INSTALL_BIN) ./files/bin/zzz-aarch64-linux-gnu $(1)/usr/bin/zzz)
|
||||
$(if $(CONFIG_TARGET_bcm27xx_bcm2711),$(INSTALL_BIN) ./files/bin/zzz-aarch64-linux-gnu $(1)/usr/bin/zzz)
|
||||
$(if $(CONFIG_TARGET_x86_64),$(INSTALL_BIN) ./files/bin/zzz-x86-64-linux-musl $(1)/usr/bin/zzz)
|
||||
$(if $(CONFIG_TARGET_armvirt_64),$(INSTALL_BIN) ./files/bin/zzz-aarch64-linux-musl $(1)/usr/bin/zzz)
|
||||
$(if $(CONFIG_TARGET_bcm27xx_bcm2711),$(INSTALL_BIN) ./files/bin/zzz-aarch64-linux-musl $(1)/usr/bin/zzz)
|
||||
$(if $(CONFIG_TARGET_ath79_generic),$(INSTALL_BIN) ./files/bin/zzz-mipsel-linux-musleabi $(1)/usr/bin/zzz)
|
||||
$(if $(CONFIG_TARGET_ramips_mt7621),$(INSTALL_BIN) ./files/bin/zzz-mipsel-linux-musleabi $(1)/usr/bin/zzz)
|
||||
$(if $(CONFIG_TARGET_mediatek_mt7622),$(INSTALL_BIN) ./files/bin/zzz-aarch64-linux-gnu $(1)/usr/bin/zzz)
|
||||
$(if $(CONFIG_TARGET_rockchip_armv8),$(INSTALL_BIN) ./files/bin/zzz-aarch64-linux-gnu $(1)/usr/bin/zzz)
|
||||
$(if $(CONFIG_TARGET_mediatek_mt7622),$(INSTALL_BIN) ./files/bin/zzz-aarch64-linux-musl $(1)/usr/bin/zzz)
|
||||
$(if $(CONFIG_TARGET_rockchip_armv8),$(INSTALL_BIN) ./files/bin/zzz-aarch64-linux-musl $(1)/usr/bin/zzz)
|
||||
# Fallback - try to detect architecture
|
||||
$(if $(findstring aarch64,$(ARCH)),$(INSTALL_BIN) ./files/bin/zzz-aarch64-linux-gnu $(1)/usr/bin/zzz)
|
||||
$(if $(findstring aarch64,$(ARCH)),$(INSTALL_BIN) ./files/bin/zzz-aarch64-linux-musl $(1)/usr/bin/zzz)
|
||||
$(if $(findstring mips,$(ARCH)),$(INSTALL_BIN) ./files/bin/zzz-mipsel-linux-musleabi $(1)/usr/bin/zzz)
|
||||
$(if $(findstring x86,$(ARCH)),$(INSTALL_BIN) ./files/bin/zzz-x86-linux-gnu $(1)/usr/bin/zzz)
|
||||
$(if $(findstring x86,$(ARCH)),$(INSTALL_BIN) ./files/bin/zzz-x86-64-linux-musl $(1)/usr/bin/zzz)
|
||||
|
||||
$(INSTALL_BIN) ./files/usr/bin/zzz-device-info $(1)/usr/bin/
|
||||
$(INSTALL_CONF) ./files/etc/config/zzz $(1)/etc/config/
|
||||
|
||||
Binary file not shown.
BIN
zzz/files/bin/zzz-aarch64-linux-musl
Normal file
BIN
zzz/files/bin/zzz-aarch64-linux-musl
Normal file
Binary file not shown.
Binary file not shown.
BIN
zzz/files/bin/zzz-x86_64-linux-musl
Normal file
BIN
zzz/files/bin/zzz-x86_64-linux-musl
Normal file
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
config general 'general'
|
||||
option enabled '0'
|
||||
option enabled '1'
|
||||
|
||||
config auth 'auth'
|
||||
option username ''
|
||||
|
||||
Reference in New Issue
Block a user