diff --git a/package/lean/leigod-acc/Makefile b/package/lean/leigod-acc/Makefile
new file mode 100644
index 000000000..65b57ce24
--- /dev/null
+++ b/package/lean/leigod-acc/Makefile
@@ -0,0 +1,58 @@
+#
+# Copyright (C) 2015-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v3.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=leigod-acc
+PKG_VERSION:=1.3.0.30
+PKG_RELEASE:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/$(PKG_NAME)
+ SECTION:=net
+ CATEGORY:=Network
+ TITLE:=Powerful Leigod Game Accelerater
+ DEPENDS:=@(x86_64||arm||mipsel||aarch64)
+ URL:=https://www.leigod.com/
+endef
+
+define Package/$(PKG_NAME)/description
+leigod-acc is a powerful game accelerater
+endef
+
+ifeq ($(ARCH),x86_64)
+ acc-arch:=amd64
+endif
+ifeq ($(ARCH),mipsel)
+ acc-arch:=mipsle
+endif
+ifeq ($(ARCH),arm)
+ acc-arch:=arm
+endif
+ifeq ($(ARCH),aarch64)
+ acc-arch:=arm64
+endif
+
+define Build/Prepare
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Package/$(PKG_NAME)/install
+ $(INSTALL_DIR) $(1)/usr/sbin/leigod
+ $(INSTALL_BIN) ./files/acc-gw.linux.$(acc-arch) $(1)/usr/sbin/leigod/acc-gw.linux.$(acc-arch)
+ $(INSTALL_BIN) ./files/leigod_uninstall.sh $(1)/usr/sbin/leigod/leigod_uninstall.sh
+ $(INSTALL_BIN) ./files/plugin_common.sh $(1)/usr/sbin/leigod/plugin_common.sh
+ $(INSTALL_BIN) ./files/update_plugin $(1)/usr/sbin/leigod/update_plugin
+ $(INSTALL_DATA) ./files/version $(1)/usr/sbin/leigod/version
+endef
+
+$(eval $(call BuildPackage,$(PKG_NAME)))
diff --git a/package/lean/leigod-acc/files/acc-gw.linux.amd64 b/package/lean/leigod-acc/files/acc-gw.linux.amd64
new file mode 100644
index 000000000..d4ddab902
Binary files /dev/null and b/package/lean/leigod-acc/files/acc-gw.linux.amd64 differ
diff --git a/package/lean/leigod-acc/files/acc-gw.linux.arm b/package/lean/leigod-acc/files/acc-gw.linux.arm
new file mode 100644
index 000000000..7b72e853d
Binary files /dev/null and b/package/lean/leigod-acc/files/acc-gw.linux.arm differ
diff --git a/package/lean/leigod-acc/files/acc-gw.linux.arm64 b/package/lean/leigod-acc/files/acc-gw.linux.arm64
new file mode 100644
index 000000000..7f9d69266
Binary files /dev/null and b/package/lean/leigod-acc/files/acc-gw.linux.arm64 differ
diff --git a/package/lean/leigod-acc/files/acc-gw.linux.mipsle b/package/lean/leigod-acc/files/acc-gw.linux.mipsle
new file mode 100644
index 000000000..d0fe35884
Binary files /dev/null and b/package/lean/leigod-acc/files/acc-gw.linux.mipsle differ
diff --git a/package/lean/leigod-acc/files/leigod_uninstall.sh b/package/lean/leigod-acc/files/leigod_uninstall.sh
new file mode 100644
index 000000000..cb9d5b5dc
--- /dev/null
+++ b/package/lean/leigod-acc/files/leigod_uninstall.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+# this script is use to install leigod plugin
+ver_name="version"
+init_file_name="acc"
+binary_prefix="acc-gw.linux"
+common_file_name="plugin_common.sh"
+download_base_url="http://119.3.40.126/router_plugin"
+
+# include common file
+. ${common_file_name}
+
+# preinstall_check
+# check and set env
+preinstall_check
+
+if [ ${is_openwrt} ]; then
+ echo "remove openwrt config"
+ remove_openwrt_series_config
+ remove_openwrt_series_init
+fi
+
+# remove_binary remove binary
+remove_binary
diff --git a/package/lean/leigod-acc/files/plugin_common.sh b/package/lean/leigod-acc/files/plugin_common.sh
new file mode 100644
index 000000000..a46c5f2c8
--- /dev/null
+++ b/package/lean/leigod-acc/files/plugin_common.sh
@@ -0,0 +1,502 @@
+# this script is use to install leigod plugin
+# sbin_dir="/usr/sbin/leigod"
+ver_name="version"
+init_file_name="acc"
+binary_prefix="acc-gw.linux"
+common_file_name="plugin_common.sh"
+uninstall_file_name="leigod_uninstall.sh"
+download_base_url="http://119.3.40.126/router_plugin"
+
+# get_device_os
+# current support os: Linux
+get_device_os() {
+ os=$(uname)
+ if [ $? == "0" ]; then
+ return 0
+ fi
+ echo "os cant be get"
+ return -1
+}
+
+# get_device_arch,
+# current support arch: arm64 arm x86_64 mips
+get_device_arch() {
+ arch=$(uname -m)
+ if [ $? == "0" ]; then
+ return 0
+ fi
+ echo "arch cant be get"
+ return -1
+}
+
+# get_xiaomi_name check if is xiaomi
+get_xiaomi_name() {
+ local name=$(uci get misc.hardware.displayName)
+ if [[ $? == "0" && ${name} != "" ]]; then
+ echo "router is xiaomi series, name: ${name}"
+ sbin_dir="/userdisk/appdata/leigod"
+ init_dir="/userdisk/appdata/leigod"
+ is_xiaomi=true
+ return 0
+ fi
+ local name=$(uci get misc.hardware.model)
+ if [[ $? == "0" && ${name} != "" ]]; then
+ echo "router is xiaomi series, name: ${name}"
+ sbin_dir="/userdisk/appdata/leigod"
+ init_dir="/userdisk/appdata/leigod"
+ is_xiaomi=true
+ return 0
+ fi
+
+ local name=$(uci get misc.hardware.model)
+ if [[ $? == "0" && ${name} != "" ]]; then
+ echo "router is xiaomi series, name: ${name}"
+ sbin_dir="/userdisk/appdata/leigod"
+ init_dir="/userdisk/appdata/leigod"
+ is_xiaomi=true
+ return 0
+ fi
+ echo "router is not xiaomi, use general openwrt"
+ sbin_dir="/usr/sbin/leigod"
+ init_dir="/etc/init.d"
+ # stop openwrt service first
+ echo "stop openwrt acc service first, in casue install failed"
+ /etc/init.d/acc stop
+ sleep 1
+ show_openwrt_suggestion
+ return 0
+}
+
+# get_asus_name get asus name
+get_merlin_party() {
+ if [[ -d "/koolshare" ]]; then
+ echo "router is merlin series, name: $(nvram get build_name)"
+ nvram set 3rd-party=merlin
+ is_merlin=true
+ sbin_dir="/koolshare/leigod/acc"
+ init_dir="/koolshare/init.d"
+ echo "message"
+ return 0
+ elif [[ -d "/jffs/softcenter" ]]; then
+ echo "router is swrt series, name: $(nvram get build_name)"
+ is_swrt=true
+ nvram set 3rd-party=swrt
+ sbin_dir="/jffs/softcenter/leigod/acc"
+ init_dir="/jffs/softcenter/init.d"
+ return 0
+ fi
+ # check merlin
+ echo "route is not merlin, use general asus"
+ return 0
+}
+
+# get_device_firmware get device firmware
+# current support firmware: openwrt merlin
+get_device_firmware() {
+ # openwrt file exist
+ if [ -f "/etc/openwrt_release" ]; then
+ echo "firmware is openwrt series"
+ is_openwrt=true
+ get_xiaomi_name
+ elif [[ -f "/etc/image_version" ]] || [[ -d "/koolshare" ]] || [[ -d "/jffs/softcenter" ]]; then
+ echo "firmware is asus series"
+ is_asus=true
+ echo "stop asus acc service first, in casue install failed"
+ PIDS=$(ps | grep acc | grep -v grep | awk '{print $1}')
+ # check if process exist
+ get_merlin_party
+ fi
+}
+
+# install_openwrt_package install openwrt
+install_binary() {
+ # create sbin dir
+ mkdir -p ${sbin_dir}
+ # create name
+ local acc_name=${binary_prefix}.${arch}
+ local download_bin_url=${download_base_url}/${acc_name}
+ echo "install ${acc_name} to ${sbin_dir}"
+ # download file
+ curl -s -o ${sbin_dir}/${acc_name} ${download_bin_url}
+ if [ $? != "0" ]; then
+ echo "download and install binary failed"
+ return -1
+ fi
+ echo "install binary success"
+ chmod +x ${sbin_dir}/${acc_name}
+ if [ $? != "0" ]; then
+ echo "add binary permission failed"
+ return -1
+ fi
+ echo "add acc binary permission success"
+ # download common file
+ local download_common_url=${download_base_url}/${common_file_name}
+ curl -s -o ${sbin_dir}/${common_file_name} ${download_common_url}
+ if [ $? != "0" ]; then
+ echo "download and install common file failed"
+ return -1
+ fi
+
+ # remote uninstall_file_name
+ local remote_uninstall_file_name=${download_base_url}/"plugin_uninstall.sh"
+ curl -s -o ${sbin_dir}/${uninstall_file_name} ${remote_uninstall_file_name}
+ if [ $? != "0" ]; then
+ echo "download and install uninstall file failed"
+ return -1
+ fi
+ echo "add uninstall permission success"
+ local ver_file=${sbin_dir}/${ver_name}
+ touch ${ver_file}
+ if [ $? != "0" ]; then
+ echo "create version file failed"
+ return -1
+ fi
+ # add version to file
+ echo "version=1.3.0.30" > ${ver_file}
+ echo "add version file success"
+}
+
+# remove_binary remove binary
+remove_binary() {
+ rm -r ${sbin_dir}
+}
+
+# install xiaomi monitor
+install_xiaomi_monitor() {
+ local cron_path="/etc/crontabs/root"
+ local monitor_file_name="plugin_monitor.sh"
+ local download_monitor_url=${download_base_url}/${monitor_file_name}
+ curl -o ${sbin_dir}/${monitor_file_name} ${download_monitor_url}
+ if [ $? != "0" ]; then
+ echo "download monitor file failed"
+ return -1
+ fi
+ chmod +x ${sbin_dir}/${monitor_file_name}
+ # download
+ echo "download monitor file success"
+ echo "*/1 * * * * ${sbin_dir}/${monitor_file_name}" >> ${cron_path}
+ if [ $? != "0" ]; then
+ echo "add monitor to cron failed"
+ return -1
+ fi
+ echo "add monitor to cron success"
+}
+
+# install_openwrt_series_config save openwrt config
+install_openwrt_series_config() {
+ # create accelerator config
+ touch /etc/config/accelerator
+ if [ $? != "0" ]; then
+ echo "make acc config file failed"
+ return -1
+ fi
+ if [ ${install_env} == "test" ]; then
+ # use uci to add config
+ uci set accelerator.base=system
+ uci set accelerator.bind=bind
+ uci set accelerator.device=hardware
+ uci set accelerator.Phone=acceleration
+ uci set accelerator.PC=acceleration
+ uci set accelerator.Game=acceleration
+ uci set accelerator.Unknown=acceleration
+ uci set accelerator.base.url='https://test-opapi.nn.com/speed/router/plug/check'
+ uci set accelerator.base.heart='https://test-opapi.nn.com/speed/router/heartbeat'
+ uci set accelerator.base.base_url='https://test-opapi.nn.com/speed'
+ uci commit accelerator
+ elif [ ${install_env} == "test1" ]; then
+ # use uci to add config
+ uci set accelerator.base=system
+ uci set accelerator.bind=bind
+ uci set accelerator.device=hardware
+ uci set accelerator.Phone=acceleration
+ uci set accelerator.PC=acceleration
+ uci set accelerator.Game=acceleration
+ uci set accelerator.Unknown=acceleration
+ uci set accelerator.base.url='https://test1-opapi.nn.com/speed/router/plug/check'
+ uci set accelerator.base.heart='https://test1-opapi.nn.com/speed/router/heartbeat'
+ uci set accelerator.base.base_url='https://test1-opapi.nn.com/speed'
+ uci commit accelerator
+ else
+ # use uci to add config
+ uci set accelerator.base=system
+ uci set accelerator.bind=bind
+ uci set accelerator.device=hardware
+ uci set accelerator.Phone=acceleration
+ uci set accelerator.PC=acceleration
+ uci set accelerator.Game=acceleration
+ uci set accelerator.Unknown=acceleration
+ uci set accelerator.base.url='https://opapi.nn.com/speed/router/plug/check'
+ uci set accelerator.base.heart='https://opapi.nn.com/speed/router/heartbeat'
+ uci set accelerator.base.base_url='https://opapi.nn.com/speed'
+ uci commit accelerator
+ fi
+ if [ $? != "0" ]; then
+ echo "create openwrt config unit failed"
+ return -1
+ fi
+ echo "create openwrt config unit success"
+}
+
+# install_openwrt_series_luasrc install openwrt lua src
+install_openwrt_series_luasrc() {
+ lua_base="/usr/lib/lua/luci"
+ # download index file
+ curl --create-dirs -o ${lua_base}/controller/acc.lua ${download_base_url}/openwrt/controller/acc.lua
+ if [ $? != "0" ]; then
+ echo "download acc.lua failed"
+ return -1
+ fi
+ # download service view file
+ curl --create-dirs -o ${lua_base}/model/cbi/leigod/service.lua ${download_base_url}/openwrt/model/cbi/leigod/service.lua
+ if [ $? != "0" ]; then
+ echo "download service.lua failed"
+ return -1
+ fi
+ # download device view file
+ curl --create-dirs -o ${lua_base}/model/cbi/leigod/device.lua ${download_base_url}/openwrt/model/cbi/leigod/device.lua
+ if [ $? != "0" ]; then
+ echo "download device.lua failed"
+ return -1
+ fi
+ # download notice view file
+ curl --create-dirs -o ${lua_base}/model/cbi/leigod/notice.lua ${download_base_url}/openwrt/model/cbi/leigod/notice.lua
+ if [ $? != "0" ]; then
+ echo "download notice.lua failed"
+ return -1
+ fi
+ # download service view file
+ curl --create-dirs -o ${lua_base}/view/leigod/notice.htm ${download_base_url}/openwrt/view/leigod/notice.htm
+ if [ $? != "0" ]; then
+ echo "download notice.htm failed"
+ return -1
+ fi
+ # download service view file
+ curl --create-dirs -o ${lua_base}/view/leigod/service.htm ${download_base_url}/openwrt/view/leigod/service.htm
+ if [ $? != "0" ]; then
+ echo "download service.htm failed"
+ return -1
+ fi
+ # download service translate file
+ curl --create-dirs -o ${lua_base}/i18n/acc.zh-cn.lmo ${download_base_url}/openwrt/po/zh-cn/acc.zh-cn.lmo
+ if [ $? != "0" ]; then
+ echo "download acc.zh-cn.lmo failed"
+ return -1
+ fi
+ echo "download lua src success"
+}
+
+install_openwrt_series_web() {
+ local luci_base="/usr/lib/lua/luci"
+
+}
+
+# remove_openwrt_series_config remove openwrt config
+remove_openwrt_series_config() {
+ rm /etc/config/accelerator
+}
+
+# install asus series config
+install_asus_series_config() {
+ mkdir -p ${sbin_dir}/config
+ if [ ${install_env} == "test" ]; then
+ # install test asus config
+ echo "
+[base]
+url="https://test-opapi.nn.com/speed/router/plug/check"
+channel="2"
+appid="nnMobile_d0k3duup"
+heart="https://test-opapi.nn.com/speed/router/heartbeat"
+base_url="https://test-opapi.nn.com/speed"
+
+[update]
+domain="https://test-opapi.nn.com/nn-version/version/plug/upgrade"
+
+[device]
+ " > ${sbin_dir}/config/accelerator
+ elif [ ${install_env} == "test1" ]; then
+ # install test1 asus config
+ echo "
+[base]
+url="https://test1-opapi.nn.com/speed/router/plug/check"
+channel="2"
+appid="nnMobile_d0k3duup"
+heart="https://test1-opapi.nn.com/speed/router/heartbeat"
+base_url="https://test1-opapi.nn.com/speed"
+
+[update]
+domain="https://test1-opapi.nn.com/nn-version/version/plug/upgrade"
+
+[device]
+ " > ${sbin_dir}/config/accelerator
+ else
+ # install formel asus config
+ echo "
+[base]
+url="https://opapi.nn.com/speed/router/plug/check"
+channel="2"
+appid="nnMobile_d0k3duup"
+heart="https://opapi.nn.com/speed/router/heartbeat"
+base_url="https://opapi.nn.com/speed"
+
+[update]
+domain="https://opapi.nn.com/nn-version/version/plug/upgrade"
+
+[device]
+ " > ${sbin_dir}/config/accelerator
+
+ fi
+
+ echo "create asus series config success"
+}
+
+# remove_asus_series_config remove asus config
+remove_asus_series_config() {
+ rm -r ${init_dir}
+}
+
+# install_openwrt_init install openwrt to init
+install_openwrt_series_init() {
+ local remote_init_name="openwrt_init.sh"
+ local download_init_url=${download_base_url}/${remote_init_name}
+ # download init file
+ curl -o ${init_dir}/${init_file_name} ${download_init_url}
+ if [ $? != "0" ]; then
+ echo "download init file failed"
+ return -1
+ fi
+ echo "download init file success"
+ # add permission to file
+ chmod +x ${init_dir}/${init_file_name}
+ if [ $? != "0" ]; then
+ echo "add init permission failed"
+ return -1
+ fi
+ echo "add init file permission success"
+ ${init_dir}/${init_file_name} enable
+ echo "set accelerator autostart success"
+ ${init_dir}/${init_file_name} start
+ if [ $? != "0" ]; then
+ echo "start accelerator failed"
+ return -1
+ fi
+ echo "start accelerator success"
+}
+
+# remove_openwrt_series_init remove openwrt init
+remove_openwrt_series_init() {
+ ${init_dir}/${init_file_name} disable
+ ${init_dir}/${init_file_name} stop
+ rm ${init_dir}/${init_file_name}
+}
+
+# install merlin init
+install_merlin_init() {
+ local remote_init_name="asus_init.sh"
+ local download_init_url=${download_base_url}/${remote_init_name}
+ # download init file
+ curl -o ${sbin_dir}/${init_file_name} ${download_init_url}
+ if [ $? != "0" ]; then
+ echo "download init file failed"
+ return -1
+ fi
+ # add permission
+ chmod +x ${sbin_dir}/${init_file_name}
+ # create link
+ local link_init_name="S99LeigodAcc.sh"
+ local link_init_file=${init_dir}/${link_init_name}
+ ln -sf ${sbin_dir}/${init_file_name} ${link_init_file}
+ if [ $? != "0" ]; then
+ echo "create merlin init link failed"
+ return -1
+ fi
+ echo "create merlin link file success"
+ ${link_init_file} start
+ echo "acc start success"
+}
+
+# show_openwrt_suggestion show openwrt install suggest
+show_openwrt_suggestion() {
+ echo "
+ 雷神OpenWrt插件安装建议:
+
+ 当前雷神路由器支持两种加速模式,
+ 1. tproxy加速模式(速度更快, CPU占用率更低)
+ 2. tun加速模式(需要依赖少, 安装灵活)
+
+ 需要您根据以上的加速模式, 安装对应的依赖库,
+ 如下列出两种模式对应的安装依赖:
+ 1. TProxy模式: libpcap iptables kmod-ipt-nat iptables-mod-tproxy kmod-ipt-tproxy kmod-netem(可选) tc-full(可选) kmod-ipt-ipset ipset curl
+ 2. Tun模式: libpcap iptables kmod-tun kmod-ipt-nat kmod-ipt-ipset ipset curl
+
+ 如何安装依赖:
+ 1. 升级依赖: opkg update
+ 2. 安装依赖: opkg install xxx
+
+ 为了安装方便, 请选择一个模式, 复制以下命令到终端运行:
+ Tproxy模式:
+ opkg update
+ opkg install libpcap iptables kmod-ipt-nat iptables-mod-tproxy kmod-ipt-tproxy kmod-netem tc-full kmod-ipt-ipset ipset
+
+ Tun模式:
+ opkg update
+ opkg install libpcap iptables kmod-tun kmod-ipt-nat kmod-ipt-ipset ipset curl
+
+ 关于steamdeck的支持说明
+ steamdeck设备请选择加速电脑游戏
+
+ 关于手机设备的支持:
+ 1. 安卓支持说明
+ 当前代理仅支持ipv4代理, 请更改dhcp配置,更改完配置请重启路由器,
+ 配置路径在 /etc/config/dhcp
+ config dhcp 'lan'
+ ... 此处是一些其他配置
+ ra 'disable'
+ dhcpv6 'disable'
+ list ra_flags 'none'
+ ... 此处是一些其他配置
+
+ 2. 关于ios设备的支持说明
+ ios设备, 安装完插件后, 为了精准识别, 请在ios上选择忘记wifi, 然后重新连接即可
+ "
+}
+
+# preinstall_check check env
+preinstall_check() {
+ # check os
+ get_device_os
+ if [ ${os} != "Linux" ]; then
+ echo "current os not support, os: ${os}"
+ return -1
+ fi
+ # check arch
+ get_device_arch
+ if [[ ${arch} != "x86_64" && ${arch} != "aarch64" && ${arch} != "arm" && ${arch} != "mips" && ${arch} != "armv7l" ]];then
+ echo "current arch not support, arch: ${arch}"
+ return -1
+ fi
+ # fix arch
+ if [ ${arch} == "x86_64" ]; then
+ echo "match x86_64 -> amd64"
+ arch="amd64"
+ elif [ ${arch} == "aarch64" ]; then
+ echo "match aarch64 -> arm64"
+ arch="arm64"
+ elif [ ${arch} == "mips" ]; then
+ echo "match mips -> mipsle"
+ arch="mipsle"
+ elif [ ${arch} == "armv7l" ]; then
+ arch="arm"
+ fi
+ # support plugin
+ echo "current system support plugin, system: ${os}-${arch}"
+ get_device_firmware
+ return 0
+}
+
+# show_install_success show install has been installed
+show_install_success() {
+ echo "install success"
+ echo "雷神路由器插件安装已完成"
+ echo "请加群632342113体验"
+}
+
diff --git a/package/lean/leigod-acc/files/update_plugin b/package/lean/leigod-acc/files/update_plugin
new file mode 100644
index 000000000..c9061d9a8
--- /dev/null
+++ b/package/lean/leigod-acc/files/update_plugin
@@ -0,0 +1,175 @@
+#!/usr/bin/lua
+
+local util = require "luci.util"
+local string = require "string"
+local io = require "io"
+local json = require "luci.jsonc"
+local uci = require "luci.model.uci".cursor()
+local client = require "luci.httpclient"
+local helper = require "luci.helper"
+
+-- get cloud version
+function get_cloud_version()
+ -- get cloud url
+ local url = uci:get("easyupdate", "main", "domain")
+ -- get request channel
+ local channel = uci:get("easyupdate", "main", "channel")
+ -- appid
+ local appid = uci:get("easyupdate", "main", "appid")
+ -- read brand and model from file
+ local brand, model = helper.get_board_info()
+ -- platfrom
+ local platform = 11
+ -- create http request options
+ local options = {}
+ -- create http request method
+ options.method = "POST"
+ -- create http request headers
+ options.headers = {}
+ options.headers['appId'] = appid
+ options.headers['reqChannel'] = channel
+ options.headers['Content-Type'] = 'application/json'
+ -- create http request body
+ local body = {
+ --
+ ['appId'] = 'spRouterPlugin_fhem2shgq9s5',
+ ['brand'] = brand,
+ ['model'] = model,
+ ['platform'] = platform,
+ }
+ -- marshal to json
+ local buf = util.serialize_json(body)
+ options.body = buf
+ -- begin to query
+ local status, _, buffer, _ = client.request_raw(url, options)
+ -- check if query success
+ if not status then
+ io.write("status is nil \n")
+ return ""
+ end
+ -- check if request success
+ if status ~= 200 and status ~=206 then
+ io.write("status is not success, status: " .. status .. "\n")
+ return ""
+ end
+ -- begin to parse response
+ local info = json.parse(buffer)
+ -- get ret data
+ local data = info['retData']
+ -- check if data is nil
+ if data == nil then
+ io.write("response ret data is nil \n")
+ return ""
+ end
+ -- store url in config
+ local fw_url = data['url']
+ local version = data['versionName']
+ io.write("fw_url: " .. fw_url .. ", version: " .. version .. "\n")
+ -- get version success
+ return version, fw_url
+end
+
+-- get local version
+function get_local_version()
+ -- run command to get acc version
+ local cmd = 'opkg info acc'
+ local buf = util.exec(cmd)
+ -- check exec result
+ if buf == nil then
+ io.write("exec command failed \n")
+ return ""
+ end
+ io.write("buf: " .. buf .. "\n")
+ -- read line
+ for line in string.gmatch(buf, "[^\r\n]+") do
+ io.write("read line: " .. line .. "\n")
+ line = string.gsub(line, " ", "")
+ local valueSl = string.gmatch(line, "[^:]+")
+ local key = valueSl()
+ local value = valueSl()
+ if key == "Version" then
+ io.write("get local version: " .. value .. "\n")
+ return value
+ end
+ end
+ io.write("local version cant found \n")
+end
+
+-- get file base name
+function get_file_base_name(filepath)
+ local name = string.gmatch(filepath, "([^/]+)$")
+ io.write("get file base name: " .. name .. "\n")
+ return name
+end
+
+-- download cloud version
+function download_cloud_app(url, name)
+ io.write("download app, url: " .. url .. ", name: " .. name .. "\n")
+ -- run download
+ local cmd = 'curl -s -o /tmp/' .. name ..' -w %{http_code}' .. ' ' .. url
+ -- exec download
+ local code = util.exec(cmd)
+ if code ~= "200" then
+ io.write("download cloud app failed, code: " .. code .. "\n")
+ return false
+ end
+ io.write("download cloud app success \n")
+ return code
+end
+
+-- install package name in tmp dir
+function install_package(name)
+ io.write("install package, package name: " .. name .. "\n")
+ local cmd = "opkg install " .. "/tmp/" .. name .. " " .. "--force-overwrite"
+ local code = util.exec(cmd)
+ io.write("install package finish, package name: " .. name .. "\n")
+ return code
+end
+
+-- remove pkg
+function remove_pkg(name)
+ io.write("remove package, package name: " .. name .. "\n")
+ local cmd = "rm -rf " .. "/tmp/" .. name
+ local code = util.exec(cmd)
+ io.write("remove package finish, package name: " .. name .. "\n")
+ return code
+end
+
+-- check network state
+io.write("check network state \n")
+while true do
+ local state_code = helper.get_network_state()
+ if state_code == 200 then
+ io.write("network available \n")
+ break
+ end
+ if state_code ~= nil then
+ io.write("network is not available, code: " .. state_code .. "\n")
+ end
+end
+io.write("network success")
+
+-- exec command
+local local_version = get_local_version()
+local cloud_version, url = get_cloud_version()
+-- check if need update
+if local_version >= cloud_version then
+ io.write("local version is new, dont need update, local ver: " .. local_version ..
+ ", cloud version:" .. cloud_version .. "\n")
+ return
+end
+
+-- need update
+io.write("local version is lower, need update, local version: " .. local_version ..
+ ", cloud version: " .. cloud_version .. "\n")
+
+-- download url
+local name = "acc.ipk"
+local result = download_cloud_app(url, name)
+if not result then
+ return
+end
+
+-- install package
+install_package(name)
+remove_pkg(name)
diff --git a/package/lean/leigod-acc/files/version b/package/lean/leigod-acc/files/version
new file mode 100644
index 000000000..aacce3421
--- /dev/null
+++ b/package/lean/leigod-acc/files/version
@@ -0,0 +1 @@
+version=1.3.0.30
diff --git a/package/lean/luci-app-leigod-acc/Makefile b/package/lean/luci-app-leigod-acc/Makefile
new file mode 100644
index 000000000..08af67ff3
--- /dev/null
+++ b/package/lean/luci-app-leigod-acc/Makefile
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2008-2014 The LuCI Team
+ 2024-8-1
+ 支持LEDE/QWRT性能优化
+ 2024-7-25
+ 支持非桥接模式下的旁路由
+ 2024-6-5
+ 扩充ipset容量, 以支持大容量代理ip库
+ 2024-1-22
+ 新增自动选择低延迟线路
+ 新增下载不限速(switch除外)
+ 设备名为*时, 显示mac地址
+
+ 插件运行需要借助一些依赖才能运行, 一般第三方固件默认已经集成了大部分的依赖,
+ 如果使用的是openwrt官方的固件, 则需要确保依赖安装好了, 以下列出依赖包和注意事项
+ libpcap
+ iptables
+ kmod-ipt-nat
+ iptables-mod-tproxy
+ kmod-ipt-tproxy
+ kmod-netem(非必须, 针对于一些icmp测速的游戏使用, 只影响界面显示, 实际游戏效果不影响)
+ tc-full(非必须, 同kmod-netem)
+ kmod-ipt-ipset
+ ipset
+ curl(谨慎更新, 某些三方固件升级curl, 会导致curl出现问题)
+
+ 加速插件无法探知当前插件应该使用什么模式,
+ 当前默认使用网桥作为流量转发的设备,
+ 如果使用旁路由模式或者docker时, 此时默认设备不是网桥,
+ 此时需要手动调整接口,
+ 改变接口的地址在 设备管理->路由设备, 选择对应的设备
+
+ 当前雷神路由器支持两种加速模式, tproxy 和 tun
+ 当前默认采用的是tproxy模式, 原因在于tproxy有更好的性能
+ tun模式暂时屏蔽, 后续luci会完善一键切换模式
+
+ 当前雷神加速插件是根据设备类型进行加速的, 也就是说, 如果加速了相应的类型后, 理论上只要连接该路由器的设备都将获得加速效果
+ 当前支持的设备类型有以下几种:
+ 手机: Android iPhone
+ 电脑: Windows MacOS SteamDeck
+ 主机: XBox Switch PlayStation
+ 未识别: Others
+ 可以在设备管理中, 插件自己的设备是否被成功识别成对应的设备, 如果不是, 可以选择对应的设备, 这样设备就能成功加速了
+
+ 一些特殊的说明:
+ 关于ios设备, 最好是在安装插件之前, 先忘记网络, 等安装完插件后, 再重新连接网络
+ 关于android设备, 需要关闭dhcpv6后, 手机重连网络, 以下给出一个 /etc/config/dhcp 的配置
+ config dhcp 'lan'
+ ... 此处是一些其他配置
+ ra 'disable'
+ dhcpv6 'disable'
+ list ra_flags 'none'
+ ... 此处是一些其他配置
+