diff --git a/package/lean/luci-app-uugamebooster/Makefile b/package/lean/luci-app-uugamebooster/Makefile index 9c407fb4ad..de6094f98c 100644 --- a/package/lean/luci-app-uugamebooster/Makefile +++ b/package/lean/luci-app-uugamebooster/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 2020 Openwrt.org +# Copyright (C) 2021 Openwrt.org # # This is free software, licensed under the Apache License, Version 2.0 . # @@ -10,8 +10,8 @@ LUCI_DEPENDS:=+uugamebooster LUCI_PKGARCH:=all PKG_NAME:=luci-app-uugamebooster PKG_VERSION:=1.0 -PKG_RELEASE:=5 +PKG_RELEASE:=7 include $(TOPDIR)/feeds/luci/luci.mk -# call BuildPackage - OpenWrt buildroot signature +# call BuildPackage - OpenWrt buildroot signature \ No newline at end of file diff --git a/package/lean/luci-app-uugamebooster/luasrc/controller/uugamebooster.lua b/package/lean/luci-app-uugamebooster/luasrc/controller/uugamebooster.lua deleted file mode 100644 index 830cffd05a..0000000000 --- a/package/lean/luci-app-uugamebooster/luasrc/controller/uugamebooster.lua +++ /dev/null @@ -1,15 +0,0 @@ -module("luci.controller.uugamebooster",package.seeall) - -function index() - if not nixio.fs.access("/etc/config/uugamebooster") then return end - - entry({"admin", "services", "uugamebooster"}, cbi("uugamebooster/uugamebooster"), ("UU Game Booster"),99).dependent=true - entry({"admin","services","uugamebooster","status"},call("act_status")).leaf=true -end - -function act_status() - local e={} - e.running=luci.sys.call("pgrep -f uugamebooster >/dev/null")==0 - luci.http.prepare_content("application/json") - luci.http.write_json(e) -end diff --git a/package/lean/luci-app-uugamebooster/luasrc/controller/uuplugin.lua b/package/lean/luci-app-uugamebooster/luasrc/controller/uuplugin.lua new file mode 100644 index 0000000000..f67e4cb7e1 --- /dev/null +++ b/package/lean/luci-app-uugamebooster/luasrc/controller/uuplugin.lua @@ -0,0 +1,15 @@ +module("luci.controller.uuplugin",package.seeall) + +function index() + if not nixio.fs.access("/etc/config/uuplugin") then return end + + entry({"admin", "services", "uuplugin"}, cbi("uuplugin/uuplugin"), ("UU GameAcc"),99).dependent=true + entry({"admin","services","uuplugin","status"},call("act_status")).leaf=true +end + +function act_status() + local e={} + e.running=luci.sys.call("pgrep -f uuplugin >/dev/null")==0 + luci.http.prepare_content("application/json") + luci.http.write_json(e) +end diff --git a/package/lean/luci-app-uugamebooster/luasrc/model/cbi/uugamebooster/uugamebooster.lua b/package/lean/luci-app-uugamebooster/luasrc/model/cbi/uugamebooster/uugamebooster.lua deleted file mode 100644 index 07333798bf..0000000000 --- a/package/lean/luci-app-uugamebooster/luasrc/model/cbi/uugamebooster/uugamebooster.lua +++ /dev/null @@ -1,24 +0,0 @@ -require("luci.util") - -mp = Map("uugamebooster", translate("UU Game Booster")) -mp.description = translate("A Paid Game Acceleration service") -mp:section(SimpleSection).template = "uugamebooster/uugamebooster_status" - -s = mp:section(TypedSection, "uugamebooster") -s.anonymous=true -s.addremove=false - -o = s:option(Flag, "enabled", translate("Enable")) -o.default = 0 -o.optional = false - -function o.write(self, section, value) - if value == "1" then - luci.sys.call("/etc/init.d/uugamebooster start >/dev/null && /etc/init.d/uugamebooster enable >/dev/null") - else - luci.sys.call("/etc/init.d/uugamebooster stop >/dev/null && /etc/init.d/uugamebooster disable >/dev/null") - end - return Flag.write(self, section, value) -end - -return mp diff --git a/package/lean/luci-app-uugamebooster/luasrc/model/cbi/uuplugin/uuplugin.lua b/package/lean/luci-app-uugamebooster/luasrc/model/cbi/uuplugin/uuplugin.lua new file mode 100644 index 0000000000..0bf3c5aa35 --- /dev/null +++ b/package/lean/luci-app-uugamebooster/luasrc/model/cbi/uuplugin/uuplugin.lua @@ -0,0 +1,17 @@ +require("luci.util") + +mp = Map("uuplugin", translate("UU Game Accelerator")) +mp.description = translate("A Paid Game Acceleration service") +mp:section(SimpleSection).template = "uuplugin/uuplugin_status" + +s = mp:section(TypedSection, "uuplugin") +s.anonymous=true +s.addremove=false + +o = s:option(Flag, "enabled", translate("Enable")) +o.default = 0 +o.optional = false + +mp:section(SimpleSection).template = "uuplugin/uuplugin_qcode" + +return mp diff --git a/package/lean/luci-app-uugamebooster/luasrc/view/uugamebooster/uugamebooster_status.htm b/package/lean/luci-app-uugamebooster/luasrc/view/uugamebooster/uugamebooster_status.htm deleted file mode 100644 index 2b83098754..0000000000 --- a/package/lean/luci-app-uugamebooster/luasrc/view/uugamebooster/uugamebooster_status.htm +++ /dev/null @@ -1,21 +0,0 @@ - - -
-

- <%:Collecting data...%> -

-
diff --git a/package/lean/luci-app-uugamebooster/luasrc/view/uuplugin/uuplugin_qcode.htm b/package/lean/luci-app-uugamebooster/luasrc/view/uuplugin/uuplugin_qcode.htm new file mode 100644 index 0000000000..12cb2e9743 --- /dev/null +++ b/package/lean/luci-app-uugamebooster/luasrc/view/uuplugin/uuplugin_qcode.htm @@ -0,0 +1,6 @@ + +
+

+ +

+
diff --git a/package/lean/luci-app-uugamebooster/luasrc/view/uuplugin/uuplugin_status.htm b/package/lean/luci-app-uugamebooster/luasrc/view/uuplugin/uuplugin_status.htm new file mode 100644 index 0000000000..c4930636ee --- /dev/null +++ b/package/lean/luci-app-uugamebooster/luasrc/view/uuplugin/uuplugin_status.htm @@ -0,0 +1,21 @@ + + +
+

+ <%:Collecting data...%> +

+
diff --git a/package/lean/luci-app-uugamebooster/po/zh-cn/uugamebooster.po b/package/lean/luci-app-uugamebooster/po/zh-cn/uugamebooster.po deleted file mode 100644 index e91029e72c..0000000000 --- a/package/lean/luci-app-uugamebooster/po/zh-cn/uugamebooster.po +++ /dev/null @@ -1,9 +0,0 @@ - -msgid "Enable" -msgstr "启用" - -msgid "UU Game Booster" -msgstr "网易UU网游加速器" - -msgid "A Paid Game Acceleration service" -msgstr "一个富家子弟用的游戏加速器" diff --git a/package/lean/luci-app-uugamebooster/po/zh-cn/uuplugin.po b/package/lean/luci-app-uugamebooster/po/zh-cn/uuplugin.po new file mode 100644 index 0000000000..d2a3ddbb4e --- /dev/null +++ b/package/lean/luci-app-uugamebooster/po/zh-cn/uuplugin.po @@ -0,0 +1,12 @@ + +msgid "Enable" +msgstr "启用" + +msgid "UU GameAcc" +msgstr "UU游戏加速器" + +msgid "UU Game Accelerator" +msgstr "UU游戏加速器" + +msgid "A Paid Game Acceleration service" +msgstr "一个富家子弟用的主机游戏加速器 (开启服务后,使用手机APP绑定路由器并指定加速主机)" diff --git a/package/lean/luci-app-uugamebooster/root/etc/config/uugamebooster b/package/lean/luci-app-uugamebooster/root/etc/config/uugamebooster deleted file mode 100644 index ed8a894041..0000000000 --- a/package/lean/luci-app-uugamebooster/root/etc/config/uugamebooster +++ /dev/null @@ -1,4 +0,0 @@ - -config uugamebooster 'uugamebooster' - option enabled '0' - diff --git a/package/lean/luci-app-uugamebooster/root/etc/config/uuplugin b/package/lean/luci-app-uugamebooster/root/etc/config/uuplugin new file mode 100644 index 0000000000..3df3127498 --- /dev/null +++ b/package/lean/luci-app-uugamebooster/root/etc/config/uuplugin @@ -0,0 +1,4 @@ + +config uuplugin 'uuplugin' + option enabled '0' + diff --git a/package/lean/luci-app-uugamebooster/root/etc/init.d/uuplugin b/package/lean/luci-app-uugamebooster/root/etc/init.d/uuplugin new file mode 100755 index 0000000000..6eec9607de --- /dev/null +++ b/package/lean/luci-app-uugamebooster/root/etc/init.d/uuplugin @@ -0,0 +1,23 @@ +#!/bin/sh /etc/rc.common + +START=99 +STOP=10 + +USE_PROCD=1 + +NAME="uugamebooster" +UU_BIN="/usr/share/uugamebooster/uuplugin" +UU_CONF="/usr/share/uugamebooster/uu.conf" +UU_LOGFILE="/tmp/uugamebooster.log" + +start_service() { + config_load uuplugin + local enable + config_get_bool enable uuplugin enabled + if [ "$enable" -eq 1 ]; then + procd_open_instance + procd_set_param command $UU_BIN $UU_CONF >$UU_LOGFILE 2>&1 + procd_set_param respawn + procd_close_instance + fi +} diff --git a/package/lean/luci-app-uugamebooster/root/etc/uci-defaults/45_luci-uugamebooster b/package/lean/luci-app-uugamebooster/root/etc/uci-defaults/45_luci-uugamebooster deleted file mode 100644 index 4eeb70d8e1..0000000000 --- a/package/lean/luci-app-uugamebooster/root/etc/uci-defaults/45_luci-uugamebooster +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -uci -q batch <<-EOF >/dev/null - delete ucitrack.@uugamebooster[-1] - add ucitrack uugamebooster - set ucitrack.@uugamebooster[-1].init=uugamebooster - commit ucitrack -EOF - -rm -f /tmp/luci-indexcache -exit 0 diff --git a/package/lean/luci-app-uugamebooster/root/etc/uci-defaults/45_luci-uuplugin b/package/lean/luci-app-uugamebooster/root/etc/uci-defaults/45_luci-uuplugin new file mode 100644 index 0000000000..e65f87ecec --- /dev/null +++ b/package/lean/luci-app-uugamebooster/root/etc/uci-defaults/45_luci-uuplugin @@ -0,0 +1,11 @@ +#!/bin/sh + +uci -q batch <<-EOF >/dev/null + delete ucitrack.@uuplugin[-1] + add ucitrack uuplugin + set ucitrack.@uuplugin[-1].init=uuplugin + commit ucitrack +EOF + +rm -f /tmp/luci-indexcache +exit 0 diff --git a/package/lean/uugamebooster/Makefile b/package/lean/uugamebooster/Makefile index cdf7226bed..10a075b0bc 100644 --- a/package/lean/uugamebooster/Makefile +++ b/package/lean/uugamebooster/Makefile @@ -13,7 +13,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uugamebooster PKG_VERSION:=v2.7.2 -PKG_RELEASE:=6 +PKG_RELEASE:=5 include $(INCLUDE_DIR)/package.mk @@ -70,8 +70,8 @@ define Build/Compile endef define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/uugamebooster.init $(1)/etc/init.d/uugamebooster + # $(INSTALL_DIR) $(1)/etc/init.d + # $(INSTALL_BIN) ./files/uugamebooster.init $(1)/etc/init.d/uuplugin $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME) $(INSTALL_BIN) $(UNTAR_DIR)/uuplugin $(1)/usr/share/$(PKG_NAME)/uuplugin diff --git a/package/lean/uugamebooster/files/uugamebooster.init b/package/lean/uugamebooster/files/uugamebooster.init deleted file mode 100755 index 7fa2ea8acc..0000000000 --- a/package/lean/uugamebooster/files/uugamebooster.init +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=99 -STOP=10 - -USE_PROCD=1 - -NAME="uugamebooster" -UU_BIN="/usr/share/uugamebooster/uuplugin" -UU_CONF="/usr/share/uugamebooster/uu.conf" -UU_LOGFILE="/tmp/uugamebooster.log" - -start_service() { - procd_open_instance - procd_set_param command $UU_BIN $UU_CONF >$UU_LOGFILE 2>&1 - procd_set_param respawn - procd_close_instance -}