Skip to content

Commit

Permalink
修复已知错误
Browse files Browse the repository at this point in the history
  • Loading branch information
gdy666 committed Feb 24, 2025
1 parent 4ef3118 commit 87030ed
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 39 deletions.
7 changes: 7 additions & 0 deletions luci-app-lucky/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ LUCI_TITLE:=LuCI Support for lucky
LUCI_DEPENDS:=+lucky
LUCI_PKGARCH:=all


define Package/$(PKG_NAME)/install
$(INSTALL_BIN) ./root/usr/bin/luckyarch $(1)/usr/bin/luckyarch
endef

include $(TOPDIR)/feeds/luci/luci.mk




# call BuildPackage - OpenWrt buildroot signature
14 changes: 14 additions & 0 deletions luci-app-lucky/root/etc/uci-defaults/66_luci-lucky
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

uci -q batch <<-EOF >/dev/null
delete ucitrack.@lucky[-1]
add ucitrack lucky
set ucitrack.@lucky[-1].init=lucky
commit ucitrack
EOF

chmod +x /usr/bin/luckyarch
rm -f /tmp/luci-indexcache* 2>/dev/null
rm -f /tmp/luci-modulecache/* 2>/dev/null # 针对OpenWrt 21.02+
rm -f /tmp/luci-indexcache
return 0
4 changes: 0 additions & 4 deletions luci-app-lucky/root/etc/uci-defaults/99_x_luckyarch.sh

This file was deleted.

27 changes: 12 additions & 15 deletions luci-app-lucky/root/usr/share/rpcd/acl.d/luci-app-lucky.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
{
"luci-app-lucky": {
"description": "Grant access to Lucky interface",
"read": {
"ubus": {
"uci": ["get"]
},
"uci": ["lucky"]
},
"write": {
"ubus": {
"uci": ["set"]
},
"uci": ["lucky"]
}
}
"luci-app-lucky": {
"description": "Grant UCI access for luci-app-lucky",
"read": {
"ubus": {
"service": [ "list" ]
},
"uci": [ "lucky" ]
},
"write": {
"uci": [ "lucky" ]
}
}
}
26 changes: 6 additions & 20 deletions lucky/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=lucky
PKG_VERSION:=2.15.7
PKG_RELEASE:=9
PKG_RELEASE:=12
PKGARCH:=all
LUCKY_CONF_DIR := /etc/config/lucky.daji
LUCKY_TMP_BACKUP := /tmp/luckyconfdir
Expand Down Expand Up @@ -71,14 +71,10 @@ define Build/Prepare
tar -xzvf $(PKG_BUILD_DIR)/$(PKG_NAME)_$(PKG_VERSION)_Linux_$(LUCKY_ARCH).tar.gz -C $(PKG_BUILD_DIR)
endef

define Package/$(PKG_NAME)/postrm
#!/bin/sh
# 仅尝试移除空目录,保留用户配置
rmdir $(LUCKY_CONF_DIR) 2>/dev/null || true
endef


define Package/$(PKG_NAME)/conffiles
/etc/config/lucky.daji/
/etc/config/lucky
endef

define Build/Compile
Expand All @@ -87,22 +83,12 @@ endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/bin/
$(INSTALL_DIR) $(1)/etc/init.d/
$(INSTALL_DIR) $(1)$(LUCKY_CONF_DIR)/
$(INSTALL_DIR) $(1)/etc/config/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lucky $(1)/usr/bin/lucky
$(INSTALL_BIN) ./files/lucky.init $(1)/etc/init.d/lucky

# Install to a temporary location
$(INSTALL_CONF) $(CURDIR)/files/luckyuci $(1)/etc/config/lucky.default
$(INSTALL_CONF) $(CURDIR)/files/luckyuci $(1)/etc/config/lucky
endef

define Package/$(PKG_NAME)/postinst
#!/bin/sh
# Copy default config if it doesn't exist
if [ ! -f /etc/config/lucky ]; then
mv /etc/config/lucky.default /etc/config/lucky
fi
rm -f /etc/config/lucky.default
exit 0
endef


$(eval $(call BuildPackage,$(PKG_NAME)))

0 comments on commit 87030ed

Please sign in to comment.