From dfbb519764455bc1167559b38bb0f7191c606f47 Mon Sep 17 00:00:00 2001 From: lean Date: Wed, 20 Jan 2021 18:26:52 +0800 Subject: [PATCH] Revert "uugamebooster & luci-app-uugamebooster: (#6217)" This reverts commit f60d3ea9c9865bb3a0e8d30463c2e0c570b6359e. --- package/lean/luci-app-uugamebooster/Makefile | 4 ++-- .../luasrc/controller/uugamebooster.lua | 15 ------------ .../luasrc/controller/uuplugin.lua | 15 ++++++++++++ .../model/cbi/uugamebooster/uugamebooster.lua | 24 ------------------- .../luasrc/model/cbi/uuplugin/uuplugin.lua | 15 ++++++++++++ .../uugamebooster/uugamebooster_status.htm | 21 ---------------- .../luasrc/view/uuplugin/uuplugin_status.htm | 21 ++++++++++++++++ .../po/zh-cn/uugamebooster.po | 9 ------- .../po/zh-cn/uuplugin.po | 12 ++++++++++ .../root/etc/config/uugamebooster | 4 ---- .../root/etc/config/uuplugin | 4 ++++ .../root/etc/init.d/uuplugin | 23 ++++++++++++++++++ .../etc/uci-defaults/45_luci-uugamebooster | 11 --------- .../root/etc/uci-defaults/45_luci-uuplugin | 11 +++++++++ package/lean/uugamebooster/Makefile | 6 ++--- .../uugamebooster/files/uugamebooster.init | 18 -------------- 16 files changed, 106 insertions(+), 107 deletions(-) delete mode 100644 package/lean/luci-app-uugamebooster/luasrc/controller/uugamebooster.lua create mode 100644 package/lean/luci-app-uugamebooster/luasrc/controller/uuplugin.lua delete mode 100644 package/lean/luci-app-uugamebooster/luasrc/model/cbi/uugamebooster/uugamebooster.lua create mode 100644 package/lean/luci-app-uugamebooster/luasrc/model/cbi/uuplugin/uuplugin.lua delete mode 100644 package/lean/luci-app-uugamebooster/luasrc/view/uugamebooster/uugamebooster_status.htm create mode 100644 package/lean/luci-app-uugamebooster/luasrc/view/uuplugin/uuplugin_status.htm delete mode 100644 package/lean/luci-app-uugamebooster/po/zh-cn/uugamebooster.po create mode 100644 package/lean/luci-app-uugamebooster/po/zh-cn/uuplugin.po delete mode 100644 package/lean/luci-app-uugamebooster/root/etc/config/uugamebooster create mode 100644 package/lean/luci-app-uugamebooster/root/etc/config/uuplugin create mode 100755 package/lean/luci-app-uugamebooster/root/etc/init.d/uuplugin delete mode 100644 package/lean/luci-app-uugamebooster/root/etc/uci-defaults/45_luci-uugamebooster create mode 100644 package/lean/luci-app-uugamebooster/root/etc/uci-defaults/45_luci-uuplugin delete mode 100755 package/lean/uugamebooster/files/uugamebooster.init diff --git a/package/lean/luci-app-uugamebooster/Makefile b/package/lean/luci-app-uugamebooster/Makefile index 9c407fb4a..9c9342446 100644 --- a/package/lean/luci-app-uugamebooster/Makefile +++ b/package/lean/luci-app-uugamebooster/Makefile @@ -10,8 +10,8 @@ LUCI_DEPENDS:=+uugamebooster LUCI_PKGARCH:=all PKG_NAME:=luci-app-uugamebooster PKG_VERSION:=1.0 -PKG_RELEASE:=5 +PKG_RELEASE:=3 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 830cffd05..000000000 --- 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 000000000..f67e4cb7e --- /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 07333798b..000000000 --- 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 000000000..071afda67 --- /dev/null +++ b/package/lean/luci-app-uugamebooster/luasrc/model/cbi/uuplugin/uuplugin.lua @@ -0,0 +1,15 @@ +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 + +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 2b8309875..000000000 --- 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_status.htm b/package/lean/luci-app-uugamebooster/luasrc/view/uuplugin/uuplugin_status.htm new file mode 100644 index 000000000..c4930636e --- /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 e91029e72..000000000 --- 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 000000000..855cf3461 --- /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 "一个富家子弟用的的游戏加速器" 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 ed8a89404..000000000 --- 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 000000000..3df312749 --- /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 000000000..6eec9607d --- /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 4eeb70d8e..000000000 --- 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 000000000..e65f87ece --- /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 cdf7226be..10a075b0b 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 7fa2ea8ac..000000000 --- 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 -}