mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-18 17:33:31 +00:00
Add luci-app-uugamebooster for uuplugin
This commit is contained in:
parent
faf254aedd
commit
121548b153
17
package/lean/luci-app-uugamebooster/Makefile
Normal file
17
package/lean/luci-app-uugamebooster/Makefile
Normal file
@ -0,0 +1,17 @@
|
||||
# Copyright (C) 2020 Openwrt.org
|
||||
#
|
||||
# This is free software, licensed under the Apache License, Version 2.0 .
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=LuCI support for UUgamebooster
|
||||
LUCI_DEPENDS:=+uugamebooster
|
||||
LUCI_PKGARCH:=all
|
||||
PKG_NAME:=luci-app-uugamebooster
|
||||
PKG_VERSION:=1.0
|
||||
PKG_RELEASE:=3
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
@ -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
|
@ -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
|
@ -0,0 +1,21 @@
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
XHR.poll(3, '<%=url([[admin]], [[services]], [[uuplugin]], [[status]])%>', null,
|
||||
function(x, data) {
|
||||
var tb = document.getElementById('uuplugin_status');
|
||||
if (data && tb) {
|
||||
if (data.running) {
|
||||
tb.innerHTML = '<em><b><font color=green>UU GameAcc <%:RUNNING%></font></b></em>';
|
||||
} else {
|
||||
tb.innerHTML = '<em><b><font color=red>UU GameAcc <%:NOT RUNNING%></font></b></em>';
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
//]]>
|
||||
</script>
|
||||
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
|
||||
<fieldset class="cbi-section">
|
||||
<p id="uuplugin_status">
|
||||
<em><%:Collecting data...%></em>
|
||||
</p>
|
||||
</fieldset>
|
12
package/lean/luci-app-uugamebooster/po/zh-cn/uuplugin.po
Normal file
12
package/lean/luci-app-uugamebooster/po/zh-cn/uuplugin.po
Normal file
@ -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 "一个富家子弟用的的游戏加速器"
|
@ -0,0 +1,4 @@
|
||||
|
||||
config uuplugin 'uuplugin'
|
||||
option enabled '0'
|
||||
|
23
package/lean/luci-app-uugamebooster/root/etc/init.d/uuplugin
Executable file
23
package/lean/luci-app-uugamebooster/root/etc/init.d/uuplugin
Executable file
@ -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
|
||||
}
|
@ -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
|
@ -13,7 +13,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=uugamebooster
|
||||
PKG_VERSION:=v2.7.2
|
||||
PKG_RELEASE:=2
|
||||
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
|
||||
|
@ -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
|
||||
}
|
Loading…
Reference in New Issue
Block a user