update 2023-02-25 18:15:32

This commit is contained in:
github-actions[bot] 2023-02-25 18:15:32 +08:00
parent 1b2dbe109b
commit 55a90e57cd
35 changed files with 0 additions and 2826 deletions

View File

@ -1,11 +0,0 @@
# This is free software, licensed under the Apache License, Version 2.0 .
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI for sysupgrade
LUCI_DEPENDS:=+luci-base
PKG_MAINTAINER:=Kiddin'
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -1 +0,0 @@
# Only for my <a href="https://github.com/garypang13/OpenWrt/">Openwrt firmware</a>

View File

@ -1,38 +0,0 @@
-- Copyright (C) 2018-2020 L-WRT Team
module("luci.controller.gpsysupgrade", package.seeall)
local appname = "gpsysupgrade"
local ucic = luci.model.uci.cursor()
local http = require "luci.http"
local util = require "luci.util"
local sysupgrade = require "luci.model.cbi.gpsysupgrade.sysupgrade"
function index()
appname = "gpsysupgrade"
entry({"admin", "services", appname}).dependent = true
entry({"admin", "services", appname}, template("gpsysupgrade/system_version"), _("System upgrade"), 1)
entry({"admin", "services", appname, "sysversion_check"}, call("sysversion_check")).leaf = true
entry({"admin", "services", appname, "sysversion_update"}, call("sysversion_update")).leaf = true
end
local function http_write_json(content)
http.prepare_content("application/json")
http.write_json(content or {code = 1})
end
function sysversion_check()
local json = sysupgrade.to_check("")
http_write_json(json)
end
function sysversion_update()
local json = nil
local task = http.formvalue("task")
if task == "flash" then
json = sysupgrade.to_flash(http.formvalue("file"),http.formvalue("retain"))
else
json = sysupgrade.to_download(http.formvalue("url"),http.formvalue("md5"))
end
http_write_json(json)
end

View File

@ -1,78 +0,0 @@
module("luci.model.cbi.gpsysupgrade.api", package.seeall)
local fs = require "nixio.fs"
local sys = require "luci.sys"
local uci = require"luci.model.uci".cursor()
local util = require "luci.util"
appname = "gpsysupgrade"
curl = "/usr/bin/curl"
curl_args = {"-skfL", "--connect-timeout 3", "--retry 3"}
wget = "/usr/bin/wget"
wget_args = {"--quiet", "--connect-timeout=3", "--timeout=6", "--tries=2"}
command_timeout = 60
LEDE_BOARD = nil
DISTRIB_TARGET = nil
function _unpack(t, i)
i = i or 1
if t[i] ~= nil then return t[i], _unpack(t, i + 1) end
end
function exec(cmd, args, writer, timeout)
local os = require "os"
local nixio = require "nixio"
local fdi, fdo = nixio.pipe()
local pid = nixio.fork()
if pid > 0 then
fdo:close()
if writer or timeout then
local starttime = os.time()
while true do
if timeout and os.difftime(os.time(), starttime) >= timeout then
nixio.kill(pid, nixio.const.SIGTERM)
return 1
end
if writer then
local buffer = fdi:read(2048)
if buffer and #buffer > 0 then
writer(buffer)
end
end
local wpid, stat, code = nixio.waitpid(pid, "nohang")
if wpid and stat == "exited" then return code end
if not writer and timeout then nixio.nanosleep(1) end
end
else
local wpid, stat, code = nixio.waitpid(pid)
return wpid and stat == "exited" and code
end
elseif pid == 0 then
nixio.dup(fdo, nixio.stdout)
fdi:close()
fdo:close()
nixio.exece(cmd, args, nil)
nixio.stdout:close()
os.exit(1)
end
end
function auto_get_board_name()
local arch = nixio.uname().machine or ""
if fs.access("/etc/openwrt_release") then
if arch == "x86_64" then
board_name = "x86_64"
else
local boardinfo = luci.util.ubus("system", "board") or { }
board_name = boardinfo.board_name
end
end
return util.trim(board_name)
end

View File

@ -1,649 +0,0 @@
module("luci.model.cbi.gpsysupgrade.sysupgrade", package.seeall)
local fs = require "nixio.fs"
local sys = require "luci.sys"
local util = require "luci.util"
local i18n = require "luci.i18n"
local api = require "luci.model.cbi.gpsysupgrade.api"
function get_system_version()
local system_version = luci.sys.exec("[ -f '/etc/openwrt_version' ] && echo -n `cat /etc/openwrt_version`")
return system_version
end
function check_update()
needs_update, notice, md5 = false, false, false
remote_version = luci.sys.exec("curl -skfL https://op.supes.top/firmware/" ..model.. "/version.txt")
updatelogs = luci.sys.exec("curl -skfL https://op.supes.top/firmware/updatelogs.txt")
remoteformat = luci.sys.exec("date -d $(echo \"" ..remote_version.. "\" | tr '\r\n' ',' | awk -F, '{printf $1}' | awk -F. '{printf $3\"-\"$1\"-\"$2}') +%s")
fnotice = luci.sys.exec("echo \"" ..remote_version.. "\" | tr '\r\n' ',' | awk -F, '{printf $(NF-1)}'")
md5 = luci.sys.exec("echo \"" ..remote_version.. "\" | tr '\r\n' ',' | awk -F, '{printf $2}'")
remote_version = luci.sys.exec("echo \"" ..remote_version.. "\" | tr '\r\n' ',' | awk -F, '{printf $1}' | awk -F. '{printf $1\".\"$2\".\"$3}'")
if remoteformat > sysverformat then
needs_update = true
if currentTimeStamp > remoteformat or fnotice == "1" then
notice = true
end
end
end
function to_check()
if not board_name or board_name == "" then board_name = api.auto_get_board_name() end
sysverformat = luci.sys.exec("date -d $(echo " ..get_system_version().. " | awk -F. '{printf $3\"-\"$1\"-\"$2}') +%s")
currentTimeStamp = luci.sys.exec("expr $(date -d \"$(date '+%Y-%m-%d %H:%M:%S')\" +%s) - 172800")
if board_name == "x86_64" then
model = "x86_64"
check_update()
if fs.access("/sys/firmware/efi") then
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-x86-64-generic-squashfs-combined-efi.img.gz"
else
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-x86-64-generic-squashfs-combined.img.gz"
md5 = ""
end
elseif board_name == "x86_generic" then
model = "x86_32"
check_update()
if fs.access("/sys/firmware/efi") then
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-x86-generic-squashfs-combined-efi.img.gz"
else
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-x86-generic-squashfs-combined.img.gz"
md5 = ""
end
elseif board_name:match("nanopi%-r2s$") then
model = "rockchip_armv8/friendlyarm_nanopi-r2s"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-rockchip-armv8-friendlyarm_nanopi-r2s-squashfs-sysupgrade.img.gz"
elseif board_name:match("nanopi%-r4s$") then
model = "rockchip_armv8/friendlyarm_nanopi-r4s"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-rockchip-armv8-friendlyarm_nanopi-r4s-squashfs-sysupgrade.img.gz"
elseif board_name:match("nanopi%-r5s$") then
model = "rockchip_armv8/friendlyarm_nanopi-r5s"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-rockchip-armv8-friendlyarm_nanopi-r5s-squashfs-sysupgrade.img.gz"
elseif board_name:match("nanopi%-r4se$") then
model = "rockchip_armv8/friendlyarm_nanopi-r4se"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-rockchip-armv8-friendlyarm_nanopi-r4se-squashfs-sysupgrade.img.gz"
elseif board_name:match("fastrhino,r68s$") then
model = "rockchip_armv8/fastrhino_r68s"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-rockchip-armv8-fastrhino_r68s-squashfs-sysupgrade.img.gz"
elseif board_name:match("fastrhino,r66s$") then
model = "rockchip_armv8/fastrhino_r66s"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-rockchip-armv8-fastrhino_r66s-squashfs-sysupgrade.img.gz"
elseif board_name:match("opc%-h68k$") then
model = "rockchip_armv8/hinlink_opc-h68k"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-rockchip-armv8-hinlink_opc-h68k-squashfs-sysupgrade.img.gz"
elseif board_name:match("nanopi%-r2c$") then
model = "rockchip_armv8/friendlyarm_nanopi-r2c"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-rockchip-armv8-friendlyarm_nanopi-r2c-squashfs-sysupgrade.img.gz"
elseif board_name:match("doornet2$") then
model = "rockchip_armv8/embedfire_doornet2"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-rockchip-armv8-embedfire_doornet2-squashfs-sysupgrade.img.gz"
elseif board_name:match("doornet1$") then
model = "rockchip_armv8/embedfire_doornet1"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-rockchip-armv8-embedfire_doornet1-squashfs-sysupgrade.img.gz"
elseif board_name:match("r1%-plus%-lts$") then
model = "rockchip_armv8/xunlong_orangepi-r1-plus-lts"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-rockchip-armv8-xunlong_orangepi-r1-plus-lts-squashfs-sysupgrade.img.gz"
elseif board_name:match("orangepi%-r1%-plus$") then
model = "rockchip_armv8/xunlong_orangepi-r1-plus"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-rockchip-armv8-xunlong_orangepi-r1-plus-squashfs-sysupgrade.img.gz"
elseif board_name:match("ariaboard,photonicat$") then
model = "rockchip_armv8/ariaboard_photonicat"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-rockchip-armv8-ariaboard_photonicat-squashfs-sysupgrade.img.gz"
elseif board_name:match("nanopi%-neo3$") then
model = "rockchip_armv8/friendlyarm_nanopi-neo3"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-rockchip-armv8-nanopi-neo3-squashfs-sysupgrade.img.gz"
elseif board_name:match("rpi%-4$") then
model = "bcm27xx_bcm2711/rpi-4"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-bcm27xx-bcm2711-rpi-4-squashfs-sysupgrade.img.gz"
elseif board_name:match("rpi%-3$") then
model = "bcm27xx_bcm2710/rpi-3"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-bcm27xx-bcm2710-rpi-3-squashfs-sysupgrade.img.gz"
elseif board_name:match("rpi%-2$") then
model = "bcm27xx_bcm2709/rpi-2"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-bcm27xx-bcm2709-rpi-2-squashfs-sysupgrade.img.gz"
elseif board_name:match("rpi$") then
model = "bcm27xx_bcm2708/rpi"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-bcm27xx-bcm2708-rpi-squashfs-sysupgrade.img.gz"
elseif board_name:match("redmi%-router%-ax6s$") then
model = "mediatek_mt7622/xiaomi_redmi-router-ax6s"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-mediatek-mt7622-xiaomi_redmi-router-ax6s-squashfs-sysupgrade.bin"
elseif board_name:match("redmi,ax6$") then
model = "ipq807x_generic/redmi_ax6"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ipq807x-generic-redmi_ax6-squashfs-sysupgrade.bin"
elseif board_name:match("xiaomi,ax9000$") then
model = "ipq807x_generic/xiaomi_ax9000"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ipq807x-generic-xiaomi_ax9000-squashfs-sysupgrade.bin"
elseif board_name:match("xiaomi,ax3600$") then
model = "ipq807x_generic/xiaomi_ax3600"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ipq807x-generic-xiaomi_ax3600-squashfs-sysupgrade.bin"
elseif board_name:match("xy%-c5$") then
model = "ramips_mt7621/xiaoyu_xy-c5"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-xiaoyu_xy-c5-squashfs-sysupgrade.bin"
elseif board_name:match("newifi%-d2$") then
model = "ramips_mt7621/d-team_newifi-d2"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-d-team_newifi-d2-squashfs-sysupgrade.bin"
elseif board_name:match("newifi%-d1$") then
model = "ramips_mt7621/lenovo_newifi-d1"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-lenovo_newifi-d1-squashfs-sysupgrade.bin"
elseif board_name:match("re%-sp%-01b$") then
model = "ramips_mt7621/jdcloud_re-sp-01b"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-jdcloud_re-sp-01b-squashfs-sysupgrade.bin"
elseif board_name:match("mi%-router%-cr660x$") then
model = "ramips_mt7621/xiaomi_mi-router-cr660x"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-xiaomi_mi-router-cr660x-squashfs-sysupgrade.bin"
elseif board_name:match("mi%-router%-3%-pro$") then
model = "ramips_mt7621/xiaomi_mi-router-3-pro"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-xiaomi_mi-router-3-pro-squashfs-sysupgrade.bin"
elseif board_name:match("mi%-router%-4$") then
model = "ramips_mt7621/xiaomi_mi-router-4"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-xiaomi_mi-router-4-squashfs-sysupgrade.bin"
elseif board_name:match("mi%-router%-3g$") then
model = "ramips_mt7621/xiaomi_mi-router-3g"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-xiaomi_mi-router-3g-squashfs-sysupgrade.bin"
elseif board_name:match("redmi%-router%-ac2100$") then
model = "ramips_mt7621/xiaomi_redmi-router-ac2100"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-xiaomi_redmi-router-ac2100-squashfs-sysupgrade.bin"
elseif board_name:match("mi%-router%-ac2100$") then
model = "ramips_mt7621/xiaomi_mi-router-ac2100"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-xiaomi_mi-router-ac2100-squashfs-sysupgrade.bin"
elseif board_name:match("phicomm,k2p$") then
model = "ramips_mt7621/phicomm_k2p"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-phicomm_k2p-squashfs-sysupgrade.bin"
elseif board_name:match("phicomm,k2p%-32m$") then
model = "ramips_mt7621/phicomm_k2p-32m"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-phicomm_k2p-32m-squashfs-sysupgrade.bin"
elseif board_name:match("phicomm,k3$") then
model = "bcm53xx_generic/phicomm_k3"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-bcm53xx-generic-phicomm_k3-squashfs.trx"
elseif board_name:match("hiwifi,hc5962$") then
model = "ramips_mt7621/hiwifi_hc5962"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-hiwifi_hc5962-squashfs-sysupgrade.bin"
elseif board_name:match("gl%-mt1300$") then
model = "ramips_mt7621/glinet_gl-mt1300"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-glinet_gl-mt1300-squashfs-sysupgrade.bin"
elseif board_name:match("rt%-ac85p$") then
model = "ramips_mt7621/asus_rt-ac85p"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-asus_rt-ac85p-squashfs-sysupgrade.bin"
elseif board_name:match("netgear,r6220$") then
model = "ramips_mt7621/netgear_r6220"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-netgear_r6220-squashfs-sysupgrade.bin"
elseif board_name:match("netgear,r6260$") then
model = "ramips_mt7621/netgear_r6260"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-netgear_r6260-squashfs-sysupgrade.bin"
elseif board_name:match("netgear,r6700%-v2$") then
model = "ramips_mt7621/netgear_r6700-v2"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-netgear_r6700-v2-squashfs-sysupgrade.bin"
elseif board_name:match("netgear,r6800$") then
model = "ramips_mt7621/netgear_r6800"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-netgear_r6800-squashfs-sysupgrade.bin"
elseif board_name:match("netgear,r6850$") then
model = "ramips_mt7621/netgear_r6850"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-netgear_r6850-squashfs-sysupgrade.bin"
elseif board_name:match("netgear,r6900%-v2$") then
model = "ramips_mt7621/netgear_r6900-v2"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-netgear_r6900-v2-squashfs-sysupgrade.bin"
elseif board_name:match("netgear,r7450$") then
model = "ramips_mt7621/netgear_r7450"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-netgear_r7450-squashfs-sysupgrade.bin"
elseif board_name:match("rt%-n56u%-b1$") then
model = "ramips_mt7621/asus_rt-n56u-b1"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-asus_rt-n56u-b1-squashfs-sysupgrade.bin"
elseif board_name:match("timecloud$") then
model = "ramips_mt7621/thunder_timecloud"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-thunder_timecloud-squashfs-sysupgrade.bin"
elseif board_name:match("yk%-l2$") then
model = "ramips_mt7621/youku_yk-l2"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-youku_yk-l2-squashfs-sysupgrade.bin"
elseif board_name:match("youhua,wr1200js$") then
model = "ramips_mt7621/youhua_wr1200js"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-youhua_wr1200js-squashfs-sysupgrade.bin"
elseif board_name:match("oraybox,x3a$") then
model = "ramramips_mt7621ips/oraybox_x3a"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-oraybox_x3a-squashfs-sysupgrade.bin"
elseif board_name:match("wndr3700%-v5$") then
model = "ramips_mt7621/netgear_wndr3700-v5"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-netgear_wndr3700-v5-squashfs-sysupgrade.bin"
elseif board_name:match("mi%-router%-4a%-gigabit$") then
model = "ramips_mt7621/xiaomi_mi-router-4a-gigabit"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-xiaomi_mi-router-4a-gigabit-squashfs-sysupgrade.bin"
elseif board_name:match("mi%-router%-3g%-v2$") then
model = "ramips_mt7621/xiaomi_mi-router-3g-v2"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-xiaomi_mi-router-3g-v2-squashfs-sysupgrade.bin"
elseif board_name:match("jcg,y2$") then
model = "ramips_mt7621/jcg_y2"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-jcg_y2-squashfs-sysupgrade.bin"
elseif board_name:match("jcg,q20$") then
model = "ramips_mt7621/jcg_q20"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-jcg_q20-squashfs-sysupgrade.bin"
elseif board_name:match("edgerouter%-x$") then
model = "ramips_mt7621/ubnt_edgerouter-x"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-ubnt_edgerouter-x-squashfs-sysupgrade.bin"
elseif board_name:match("edgerouter%-x%-sfp$") then
model = "ramips_mt7621/ubnt_edgerouter-x-sfp"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-ubnt_edgerouter-x-sfp-squashfs-sysupgrade.bin"
elseif board_name:match("msg1500%-x%-00$") then
model = "ramips_mt7621/raisecom_msg1500-x-00"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-raisecom_msg1500-x-00-squashfs-sysupgrade.bin"
elseif board_name:match("zte,e8820s$") then
model = "ramips_mt7621/zte_e8820s"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-zte_e8820s-squashfs-sysupgrade.bin"
elseif board_name:match("ghl%-r%-001$") then
model = "ramips_mt7621/gehua_ghl-r-001"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-gehua_ghl-r-001-squashfs-sysupgrade.bin"
elseif board_name:match("linksys,ea7500%-v2$") then
model = "ramips_mt7621/linksys_ea7500-v2"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-linksys_ea7500-v2-squashfs-sysupgrade.bin"
elseif board_name:match("linksys,ea8100%-v1$") then
model = "ramips_mt7621/linksys_ea8100-v1"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-linksys_ea8100-v1-squashfs-sysupgrade.bin"
elseif board_name:match("linksys,ea8100%-v2$") then
model = "ramips_mt7621/linksys_ea8100-v2"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-linksys_ea8100-v2-squashfs-sysupgrade.bin"
elseif board_name:match("linksys,ea7300%-v1$") then
model = "ramips_mt7621/linksys_ea7300-v1"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-linksys_ea7300-v1-squashfs-sysupgrade.bin"
elseif board_name:match("linksys,ea7300%-v2$") then
model = "ramips_mt7621/linksys_ea7300-v2"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-linksys_ea7300-v2-squashfs-sysupgrade.bin"
elseif board_name:match("linksys,ea6350%-v4$") then
model = "ramips_mt7621/linksys_ea6350-v4"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-linksys_ea6350-v4-squashfs-sysupgrade.bin"
elseif board_name:match("linksys,e5600$") then
model = "ramips_mt7621/linksys_e5600"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-linksys_e5600-squashfs-sysupgrade.bin"
elseif board_name:match("jdcloud,luban$") then
model = "ramips_mt7621/jdcloud_luban"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7621-jdcloud_luban-squashfs-sysupgrade.bin"
elseif board_name:match("rt%-ac1200$") then
model = "ramips_mt76x8/asus_rt-ac1200"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt76x8-asus_rt-ac1200-squashfs-sysupgrade.bin"
elseif board_name:match("rt%-ac1200%-v2$") then
model = "ramips_mt76x8/asus_rt-ac1200-v2"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt76x8-asus_rt-ac1200-v2-squashfs-sysupgrade.bin"
elseif board_name:match("gl%-mt300n%-v2$") then
model = "ramips_mt76x8/glinet_gl-mt300n-v2"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt76x8-glinet_gl-mt300n-v2-squashfs-sysupgrade.bin"
elseif board_name:match("microuter%-n300$") then
model = "ramips_mt76x8/glinet_microuter-n300"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt76x8-glinet_microuter-n300-squashfs-sysupgrade.bin"
elseif board_name:match("hiwifi,hc5661a$") then
model = "ramips_mt76x8/hiwifi_hc5661a"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt76x8-hiwifi_hc5661a-squashfs-sysupgrade.bin"
elseif board_name:match("hiwifi,hc5761a$") then
model = "ramips_mt76x8/hiwifi_hc5761a"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt76x8-hiwifi_hc5761a-squashfs-sysupgrade.bin"
elseif board_name:match("hiwifi,hc5861b$") then
model = "ramips_mt76x8/hiwifi_hc5861b"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt76x8-hiwifi_hc5861b-squashfs-sysupgrade.bin"
elseif board_name:match("hiwifi,hc5611$") then
model = "ramips_mt76x8/hiwifi_hc5611"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt76x8-hiwifi_hc5611-squashfs-sysupgrade.bin"
elseif board_name:match("netgear,r6120$") then
model = "ramips_mt76x8/netgear_r6120"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt76x8-netgear_r6120-squashfs-sysupgrade.bin"
elseif board_name:match("miwifi%-nano$") then
model = "ramips_mt76x8/xiaomi_miwifi-nano"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt76x8-xiaomi_miwifi-nano-squashfs-sysupgrade.bin"
elseif board_name:match("r619ac%-64m$") then
model = "ipq40xx_generic/p2w_r619ac-64m"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ipq40xx-generic-p2w_r619ac-64m-squashfs-nand-sysupgrade.bin"
elseif board_name:match("r619ac%-128m$") then
model = "ipq40xx_generic/p2w_r619ac-128m"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ipq40xx-generic-p2w_r619ac-128m-squashfs-nand-sysupgrade.bin"
elseif board_name:match("rt%-ac42u$") then
model = "ipq40xx_generic/asus_rt-ac42u"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ipq40xx-generic-asus_rt-ac42u-squashfs-sysupgrade.bin"
elseif board_name:match("rt%-ac58u$") then
model = "ipq40xx_generic/asus_rt-ac58u"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ipq40xx-generic-asus_rt-ac58u-squashfs-sysupgrade.bin"
elseif board_name:match("cm520%-79f$") then
model = "ipq40xx_generic/mobipromo_cm520-79f"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ipq40xx-generic-mobipromo_cm520-79f-squashfs-nand-sysupgrade.bin"
elseif board_name:match("gl%-a1300$") then
model = "ipq40xx_generic/glinet_gl-a1300"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ipq40xx-generic-glinet_gl-a1300-squashfs-nand-sysupgrade.bin"
elseif board_name:match("rt%-ac88u$") then
model = "bcm53xx_generic/asus_rt-ac88u"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-bcm53xx-generic-asus_rt-ac88u-squashfs.trx"
elseif board_name:match("linksys,wrt1200ac$") then
model = "mvebu_cortexa9/linksys_wrt1200ac"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-mvebu-cortexa9-linksys_wrt1200ac-squashfs-sysupgrade.bin"
elseif board_name:match("linksys,wrt1900ac%-v2$") then
model = "mvebu_cortexa9/linksys_wrt1900ac-v2"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-mvebu-cortexa9-linksys_wrt1900ac-v2-squashfs-sysupgrade.bin"
elseif board_name:match("linksys,wrt1900ac%-v1$") then
model = "mvebu_cortexa9/linksys_wrt1900ac-v1"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-mvebu-cortexa9-linksys_wrt1900ac-v1-squashfs-sysupgrade.bin"
elseif board_name:match("linksys,wrt3200acm$") then
model = "mvebu_cortexa9/linksys_wrt3200acm"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-mvebu-cortexa9-linksys_wrt3200acm-squashfs-sysupgrade.bin"
elseif board_name:match("linksys,wrt1900acs$") then
model = "mvebu_cortexa9/linksys_wrt1900acs"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-mvebu-cortexa9-linksys_wrt1900acs-squashfs-sysupgrade.bin"
elseif board_name:match("linksys,wrt32x$") then
model = "mvebu_cortexa9/linksys_wrt32x"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-mvebu-cortexa9-linksys_wrt32x-squashfs-sysupgrade.bin"
elseif board_name:match("qihoo,v6$") then
model = "ipq60xx_generic/qihoo_v6"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ipq60xx-generic-qihoo_v6-squashfs-nand-sysupgrade.bin"
elseif board_name:match("glinet,axt1800$") then
model = "ipq807x_ipq60xx/glinet_axt1800"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ipq807x-glinet_axt1800-squashfs-sysupgrade.tar"
elseif board_name:match("glinet,ax1800$") then
model = "ipq807x_ipq60xx/glinet_ax1800"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ipq807x-glinet_ax1800-squashfs-sysupgrade.tar"
elseif board_name:match("linksys,mr7350$") then
model = "ipq60xx_generic/linksys_mr7350"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ipq60xx-generic-linksys_mr7350-squashfs-nand-sysupgrade.bin"
elseif board_name:match("cmiot,ax18$") then
model = "ipq60xx_generic/cmiot_ax18"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ipq60xx-generic-cmiot_ax18-squashfs-nand-sysupgrade.bin"
elseif board_name:match("zn,m2$") then
model = "ipq60xx_generic/zn_m2"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ipq60xx-generic-zn_m2-squashfs-nand-sysupgrade.bin"
elseif board_name:match("xiaomi,rm1800$") then
model = "ipq60xx_generic/xiaomi_rm1800"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ipq60xx-generic-xiaomi_rm1800-squashfs-nand-sysupgrade.bin"
elseif board_name:match("wf%-hr6001$") then
model = "ipq60xx_generic/huasifei_wf-hr6001"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ipq60xx-generic-huasifei_wf-hr6001-squashfs-nand-sysupgrade.bin"
elseif board_name:match("gl%-mt300a$") then
model = "ramips_mt7620/glinet_gl-mt300a"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7620-glinet_gl-mt300a-squashfs-sysupgrade.bin"
elseif board_name:match("gl%-mt750$") then
model = "ramips_mt7620/glinet_gl-mt750"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7620-glinet_gl-mt750-squashfs-sysupgrade.bin"
elseif board_name:match("hiwifi,hc5661$") then
model = "ramips_mt7620/hiwifi_hc5661"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7620-hiwifi_hc5661-squashfs-sysupgrade.bin"
elseif board_name:match("hiwifi,hc5761$") then
model = "ramips_mt7620/hiwifi_hc5761"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7620-hiwifi_hc5761-squashfs-sysupgrade.bin"
elseif board_name:match("hiwifi,hc5861$") then
model = "ramips_mt7620/hiwifi_hc5861"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7620-hiwifi_hc5861-squashfs-sysupgrade.bin"
elseif board_name:match("newifi%-y1$") then
model = "ramips_mt7620/lenovo_newifi-y1"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7620-lenovo_newifi-y1-squashfs-sysupgrade.bin"
elseif board_name:match("newifi%-y1s$") then
model = "ramips_mt7620/lenovo_newifi-y1s"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7620-lenovo_newifi-y1s-squashfs-sysupgrade.bin"
elseif board_name:match("miwifi%-mini$") then
model = "ramips_mt7620/xiaomi_miwifi-mini"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7620-xiaomi_miwifi-mini-squashfs-sysupgrade.bin"
elseif board_name:match("yk%-l1$") then
model = "ramips_mt7620/youku_yk-l1"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7620-youku_yk-l1-squashfs-sysupgrade.bin"
elseif board_name:match("yk%-l1c$") then
model = "ramips_mt7620/youku_yk-l1c"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7620-youku_yk-l1c-squashfs-sysupgrade.bin"
elseif board_name:match("miwifi%-r3$") then
model = "ramips_mt7620/xiaomi_miwifi-r3"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7620-xiaomi_miwifi-r3-squashfs-sysupgrade.bin"
elseif board_name:match("hiwifi,r33$") then
model = "ramips_mt7620/hiwifi_r33"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ramips-mt7620-hiwifi_r33-squashfs-sysupgrade.bin"
elseif board_name:match("redmi%-router%-ax6000$") then
model = "mediatek_mt7986/xiaomi_redmi-router-ax6000"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-mediatek-mt7986-xiaomi_redmi-router-ax6000-squashfs-sysupgrade.bin"
elseif board_name:match("mt7981%-360%-t7%-108M$") then
model = "mediatek_mt7981/mt7981-360-t7-108M"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-mediatek-mt7981-mt7981-360-t7-108M-squashfs-sysupgrade.bin"
elseif board_name:match("linksys,ea4500$") then
model = "kirkwood_generic/linksys_ea4500"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-kirkwood-linksys_ea4500-squashfs-sysupgrade.bin"
elseif board_name:match("linksys,e4200%-v2$") then
model = "kirkwood_generic/linksys_e4200-v2"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-kirkwood-linksys_e4200-v2-squashfs-sysupgrade.bin"
elseif board_name:match("thunder%-onecloud$") then
model = "meson_meson8/thunder-onecloud"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-meson-meson8b-thunder-onecloud-ext4-sdcard.img.gz"
elseif board_name:match("gl%-ar300m%-nand$") then
model = "ath79_nand/glinet_gl-ar300m-nand"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ath79-nand-glinet_gl-ar300m-nand-squashfs-sysupgrade.bin"
elseif board_name:match("gl%-ar750s%-nor%-nand$") then
model = "ath79_nand/glinet_gl-ar750s-nor-nand"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ath79-nand-glinet_gl-ar750s-nor-nand-squashfs-sysupgrade.bin"
elseif board_name:match("gl%-e750$") then
model = "ath79_nand/glinet_gl-e750"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ath79-nand-glinet_gl-e750-squashfs-sysupgrade.bin"
elseif board_name:match("gl%-xe300$") then
model = "ath79_nand/glinet_gl-xe300"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ath79-nand-glinet_gl-xe300-squashfs-sysupgrade.bin"
elseif board_name:match("netgear,r6100$") then
model = "ath79_nand/netgear_r6100"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ath79-nand-netgear_r6100-squashfs-sysupgrade.bin"
elseif board_name:match("wndr3700%-v4$") then
model = "ath79_nand/netgear_wndr3700-v4"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ath79-nand-netgear_wndr3700-v4-squashfs-sysupgrade.bin"
elseif board_name:match("netgear,wndr4300$") then
model = "ath79_nand/netgear_wndr4300"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ath79-nand-netgear_wndr4300-squashfs-sysupgrade.bin"
elseif board_name:match("wndr4300%-v2$") then
model = "ath79_nand/netgear_wndr4300-v2"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ath79-nand-netgear_wndr4300-v2-squashfs-sysupgrade.bin"
elseif board_name:match("netgear,wndr4300sw$") then
model = "ath79_nand/netgear_wndr4300sw"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ath79-nand-netgear_wndr4300sw-squashfs-sysupgrade.bin"
elseif board_name:match("netgear,wndr4300tn$") then
model = "ath79_nand/netgear_wndr4300tn"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ath79-nand-netgear_wndr4300tn-squashfs-sysupgrade.bin"
elseif board_name:match("wndr4500%-v3$") then
model = "ath79_nand/netgear_wndr4500-v3"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ath79-nand-netgear_wndr4500-v3-squashfs-sysupgrade.bin"
elseif board_name:match("zte,mf286$") then
model = "ath79_nand/zte_mf286"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ath79-nand-zte_mf286-squashfs-sysupgrade.bin"
elseif board_name:match("gl%-mt2500$") then
model = "mt7981/glinet_gl-mt2500"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-mediatek_gl-mt7981-glinet_gl-mt2500-squashfs-sysupgrade.bin"
elseif board_name:match("gl%-mt3000$") then
model = "mt7981/glinet_gl-mt3000"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-mediatek_gl-mt7981-glinet_gl-mt3000-squashfs-sysupgrade.bin"
elseif board_name:match("gl%-x3000$") then
model = "mt7981/glinet_gl-x3000"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-mediatek_gl-mt7981-glinet_gl-x3000-squashfs-sysupgrade.bin"
elseif board_name:match("gl%-xe3000$") then
model = "mt7981/glinet_gl-xe3000"
check_update()
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-mediatek_gl-mt7981-glinet_gl-xe3000-squashfs-sysupgrade.bin"
else
local needs_update = false
return {
code = 1,
error = i18n.translate("Can't determine MODEL, or MODEL not supported.")
}
end
if needs_update and not download_url then
return {
code = 1,
now_version = get_system_version(),
version = remote_version,
error = i18n.translate(
"New version found, but failed to get new version download url.")
}
end
return {
code = 0,
update = needs_update,
notice = notice,
now_version = get_system_version(),
version = remote_version,
md5 = md5,
logs = updatelogs,
url = download_url
}
end
function to_download(url,md5)
if not url or url == "" then
return {code = 1, error = i18n.translate("Download url is required.")}
end
sys.call("/bin/rm -f /tmp/firmware_download.*")
local tmp_file = util.trim(util.exec("mktemp -u -t firmware_download.XXXXXX"))
local result = api.exec(api.wget, {api._unpack(api.wget_args), "-O", tmp_file, url}, nil, api.command_timeout) == 0
if not result then
api.exec("/bin/rm", {"-f", tmp_file})
return {
code = 1,
error = i18n.translatef("File download failed or timed out: %s", url)
}
end
local md5local = sys.exec("echo -n $(md5sum " .. tmp_file .. " | awk '{print $1}')")
if md5 ~= "" and md5local ~= md5 then
api.exec("/bin/rm", {"-f", tmp_file})
return {
code = 1,
error = i18n.translatef("Md5 check failed: %s", url)
}
end
return {code = 0, file = tmp_file}
end
function to_flash(file,retain)
if not file or file == "" or not fs.access(file) then
return {code = 1, error = i18n.translate("Firmware file is required.")}
end
sys.call("/sbin/sysupgrade " ..retain.. " " ..file.. "")
return {code = 0}
end

View File

@ -1,40 +0,0 @@
<%
local fs = require "nixio.fs"
local uci = require 'luci.model.uci'.cursor()
if fs.access('/etc/config/wizard') then
autoupgrade_fm = uci:get('wizard', 'default', 'autoupgrade_fm')
end
if autoupgrade_fm == '1' then
-%>
<script>
var tokenStr = '<%=token%>';
XHR.get('<%=url([[admin]], [[services]], [[gpsysupgrade]], [[sysversion_check]])%>', {
token: tokenStr,
model: ''
}, function(x,json) {
if(json.code) {
} else {
if(json.notice) {
sysUpgradeInfo = json;
setTimeout(function(){
var ckeckDetailElm = document.querySelector("#maincontent");
if(ckeckDetailElm) {
var urlNode = '';
if(json.version) {
urlNode = '<div class="alert-message fade-in success" style="display:flex;margin-top: -1.5rem;padding: 0.31rem 0rem;"><div style="flex:10"><a href="<%=url([[admin]], [[services]], [[gpsysupgrade]])%>"><p><%:New version available%>' + json.version + '</p></a></div></div>';
ckeckDetailElm.innerHTML=urlNode+ckeckDetailElm.innerHTML;
}
}
}, 0);
} else {
}
}
},300);
</script>
<% end -%>

View File

@ -1,249 +0,0 @@
<%
local system_version = require "luci.model.cbi.gpsysupgrade.sysupgrade".get_system_version()
-%>
<%+header%>
<h2 name="content"><%:System upgrade%></h2>
<%- local c = require("luci.model.uci").cursor():changes(); if c and next(c) then -%>
<p class="alert-message warning"><%:Warning: There are unsaved changes that will get lost on reboot!%></p>
<%- end -%>
<script type="text/javascript">
//<![CDATA[
var sysUpgradeInfo;
var tokenStr = '<%=token%>';
var clickToForceUpdateText = '<%:It is the latest version,Reflash?%>';
var updateSuccessText = '<%:Upgrade successful%>';
var clickToUpdateText = '<%:Click to Upgrade%>';
var inProgressText = '<%:Upgrading...%>';
var unexpectedErrorText = '<%:Unexpected error%>';
var updateInProgressNotice = '<%:Upgrading, are you sure to close?%>';
var downloadingText = '<%:Downloading...%>';
var flashing = '<%:Flashing...%>';
var checking = '<%:Checking...%>';
window.onload = function() {
var sysupCheckBtn = document.getElementById('_sysup-check_btn');
checkUpdate_sysup(sysupCheckBtn)
};
function addPageNotice_sysup() {
window.onbeforeunload = function(e) {
e.returnValue = updateInProgressNotice;
return updateInProgressNotice;
};
}
function removePageNotice_sysup() {
window.onbeforeunload = null;
}
function onUpdateSuccess_sysup(btn) {
alert(updateSuccessText);
if(btn) {
btn.value = updateSuccessText;
btn.placeholder = updateSuccessText;
btn.disabled = true;
}
window.setTimeout(function() {
window.location.reload();
}, 1000);
}
function onRequestError_sysup(btn, errorMessage) {
btn.disabled = false;
btn.value = btn.placeholder;
if(errorMessage) {
alert(errorMessage);
}
}
function onBtnClick_sysup(btn) {
if(sysUpgradeInfo === undefined) {
checkUpdate_sysup(btn);
} else {
doUpdate_sysup(btn);
}
}
function checkUpdate_sysup(btn) {
btn.disabled = true;
btn.value = checking;
addPageNotice_sysup();
var ckeckDetailElm = document.getElementById(btn.id + '-detail');
var updateLogs = document.getElementById('updatelogs');
XHR.get('<%=url([[admin]], [[services]], [[gpsysupgrade]], [[sysversion_check]])%>', {
token: tokenStr,
model: ''
}, function(x,json) {
removePageNotice_sysup();
if(json.code) {
sysUpgradeInfo = undefined;
onRequestError_sysup(btn, json.error);
} else {
document.querySelector('#retain').style.display = '';
if(json.update) {
sysUpgradeInfo = json;
btn.disabled = false;
btn.value = clickToUpdateText;
btn.placeholder = clickToUpdateText;
if(ckeckDetailElm) {
var urlNode = '';
if(json.version) {
if(json.notice) {
urlNode = '<em style="color:red;">最新版本号:' + json.version + ' &nbsp;正式版</em>';
} else {
urlNode = '<em style="color:red;">最新版本号:' + json.version + ' &nbsp;尝鲜版</em>';
}
}
if(json.logs) {
logs = '<div class="alert alert-message">' + json.logs + '</div>';
}
ckeckDetailElm.innerHTML = urlNode;
updateLogs.innerHTML = logs;
}
} else {
sysUpgradeInfo = json;
btn.disabled = false;
btn.value = clickToForceUpdateText;
btn.placeholder = clickToForceUpdateText;
}
}
},300);
}
function doUpdate_sysup(btn) {
btn.disabled = true;
btn.value = downloadingText;
addPageNotice_sysup();
var sysUpgradeUrl = '<%=url([[admin]], [[services]], [[gpsysupgrade]], [[sysversion_update]])%>';
// Download file
XHR.get(sysUpgradeUrl, {
token: tokenStr,
url: sysUpgradeInfo ? sysUpgradeInfo.url : '',
md5: sysUpgradeInfo ? sysUpgradeInfo.md5 : ''
}, function(x,json) {
if(json.code) {
removePageNotice_sysup();
onRequestError_sysup(btn, json.error);
} else {
btn.value = flashing;
message.style.display = '';
label.innerHTML = '<%:Upgrade successful, Waiting for device...%>';
var opts = "";
if (!kconfig.checked){
opts = "-n";
}
if (kopkg.checked){
opts = "-k";
}
if (!kconfig.checked && kopkg.checked){
opts = "-n -k";
}
removePageNotice_sysup();
setTimeout(check, 8000);
XHR.get(sysUpgradeUrl, {
token: tokenStr,
task: 'flash',
file: json.file,
retain: opts
}, function(x,json) {
},300)
}
},300)
}
//]]>
</script>
<div class="cbi-value">
<label class="value-title" style="float:left;">
<%:Current system version%>
</label>
<div class="cbi-value-description">
<span><%=system_version%> 】</span>
&nbsp;&nbsp;&nbsp;<span id="_sysup-check_btn-detail"></span>
</div>
<style>
#updatelogs .alert-message p{
text-align:left;
}
#updatelogs .alert-message a{
color: orangered;
text-decoration: underline;
}
.red{
color: orangered;
}
#updatelogs h4{
padding-bottom:0;
}
#updatelogs h4.title{
font-size:130%
}
</style>
<%
local boardinfo = luci.util.ubus("system", "board") or { }
overlay = boardinfo.release.distribution
%>
<%- if overlay ~="OpenWrt" and overlay ~= "1004" then -%>
<b style="color:orangered">注意: 修改过根目录大小的定制固件请使用<a target="_blank" href="https://supes.top"> 网站 </a>或安装luci-app-attendedsysupgrade重新生成定制固件, 直接用此在线更新会重置分区,丢失配置.</b>
<%- end -%>
<pre id="updatelogs" style="font-family:Microsoft Yahei;line-height:1.5rem;white-space:pre-line;"></div>
<div id="retain" style="display:none;margin:0.5rem;">
<p style="margin-top:0.4rem;"><button class="btn"><input type="checkbox" checked id="kconfig"> <%:Keep settings and retain the current configuration%></button></p>
<p style="margin-top:0.5rem;"><button class="btn"><input type="checkbox" checked id="kopkg"> <%:Retain the current packages%></button></p>
</div>
<input class="cbi-button cbi-input-apply cbi-button-reset" type="button" id="_sysup-check_btn" onclick="onBtnClick_sysup(this);" value="<%:Check update%>" style="margin-top:0.5rem;"/>
</div>
<p class="alert-message notice reboot-message" style="display:none">
<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" />
<span><%:Device is rebooting...%></span>
</p>
<script type="text/javascript">
//<![CDATA[
var tries = 0,
kconfig = document.querySelector('#kconfig'),
kopkg = document.querySelector('#kopkg');
var message = document.querySelector('p.reboot-message');
var label = message.querySelector('span');
function ok() {
window.location = '<%=url("admin")%>';
}
function check() {
window.setTimeout(ping, 3000);
}
function ping() {
var img = document.createElement('img');
img.onload = ok;
img.onerror = check;
img.src = '<%=resource%>/icons/loading.gif?' + Math.random();
if (tries++ >= 30) {
message.classList.remove('notice');
message.classList.add('warning');
label.innerHTML = '<%:Device unreachable! Still waiting for device...%>';
}
}
//]]>
</script>
<%+footer%>

View File

@ -1 +0,0 @@
zh_Hans

View File

@ -1,68 +0,0 @@
msgid "System upgrade"
msgstr "系统在线更新"
msgid "Upgrade..."
msgstr "更新中"
msgid "Current system version"
msgstr "当前固件版本"
msgid "It is the latest version,Reflash?"
msgstr "已是最新版,重刷此版本?"
msgid "Upgrade successful"
msgstr "更新成功"
msgid "Click to Upgrade"
msgstr "点击更新"
msgid "Upgrading..."
msgstr "更新中"
msgid "Checking..."
msgstr "正在检查更新"
msgid "Flashing..."
msgstr "正在刷入..."
msgid "Check update"
msgstr "检查更新"
msgid "Unexpected error"
msgstr "意外错误"
msgid "Upgrading, are you sure to close?"
msgstr "正在更新,你确认要关闭吗?"
msgid "Downloading..."
msgstr "下载中"
msgid "Unpacking..."
msgstr "解压中"
msgid "Can't determine MODEL, or MODEL not supported."
msgstr "无法确认型号,或是不支持。"
msgid "Get remote version info failed."
msgstr "获取远程版本信息失败。"
msgid "New version found, but failed to get new version download url."
msgstr "发现新版本,但未能获得新版本的下载地址。"
msgid "File download failed or timed out: %s"
msgstr "固件下载失败或超时, 请重试. 或下载:%s 到本地, 通过 系统->备份/升级 上传更新."
msgid "Firmware file required."
msgstr "固件文件未找到。"
msgid "New version available"
msgstr "新版本可用"
msgid "Upgrade successful, Waiting for device..."
msgstr "更新成功, 等待设备重启后响应..."
msgid "Device unreachable! Still waiting for device..."
msgstr "无法连接设备! 继续等待..."
msgid "Retain the current packages"
msgstr "保留已安装软件包 (系统更新完成联网后自动在线安装回原有软件包)"

View File

@ -1,18 +0,0 @@
. /lib/functions/network.sh
network_flush_cache
network_find_wan NET_IF
network_find_wan6 NET_IF6
if [ "${INTERFACE}" != "${NET_IF}" ] \
&& [ "${INTERFACE}" != "${NET_IF6}" ]
then exit 0
fi
if [ "${ACTION}" != "ifup" ] \
&& [ "${ACTION}" != "ifupdate" ]
then exit 0
fi
if [ "${ACTION}" = "ifupdate" ] \
&& [ -z "${IFUPDATE_ADDRESSES}" ] \
&& [ -z "${IFUPDATE_DATA}" ]
then exit 0
fi
hotplug-call online

View File

@ -1,39 +0,0 @@
. /etc/profile.d/opkg.sh
OPKG_PI="$(opkg export pi)"
if [ ! -e /etc/opkg-restore-auto ] \
&& lock -n /var/lock/opkg-restore && [ -s "${OPKG_PI}" ]; then
c=0
while ! curl https://op.supes.top >/dev/null || ! opkg update >/dev/null; do
echo "Network error." | logger -t opkg
[[ "$(uci -q get dhcp.@dnsmasq[0].noresolv)" == 1 && $c == 3 ]] && {
uci -q del dhcp.@dnsmasq[0].noresolv
uci commit dhcp
uci -q get network.lan.dns || {
uci -q set network.lan.dns='223.5.5.5'
uci commit network
/etc/init.d/network reload
}
/etc/init.d/dnsmasq reload
}
[ $c -eq 300 ] && {
lock -u /var/lock/opkg-restore
exit 0
} || let c++
sleep 3
done
c1=0
logs="1"
while [ "$logs" != "" ]; do
logs="$(opkg restore)"
echo "${logs}" | logger -t opkg
[ $c1 -eq 5 ] && {
lock -u /var/lock/opkg-restore
exit 0
} || let c1++
sleep 2
done
touch /etc/opkg-restore-auto
fi
lock -u /var/lock/opkg-restore

View File

@ -1,5 +0,0 @@
if [ "$(uci -q get wizard.default.autoupgrade_pkg)" == '1' ] && lock -n /var/lock/opkg-upgrade && opkg update; then
. /etc/profile.d/opkg.sh
opkg upgr 2>&1 | logger -t opkg
fi
lock -u /var/lock/opkg-upgrade

View File

@ -1,207 +0,0 @@
opkg() {
local OPKG_CMD="${1}"
local OPKG_UCI="$(uci -q get opkg.defaults."${OPKG_CMD}")"
case "${OPKG_CMD}" in
(init|uci|import|save|restore|rollback\
|upgr|export|newconf|proc|reinstall) opkg_"${@}" ;;
(*) command opkg "${@}" ;;
esac
}
opkg_init() {
uci import opkg < /dev/null
uci -q batch << EOI
set opkg.defaults='opkg'
set opkg.defaults.save='auto'
set opkg.defaults.restore='auto'
set opkg.defaults.rollback='auto'
set opkg.defaults.upgr='ai'
set opkg.defaults.export='ai'
set opkg.defaults.proc='--force-overwrite --force-checksum --force-depends'
set opkg.defaults.reinstall='--force-reinstall --force-overwrite --force-checksum --force-depends'
set opkg.defaults.newconf='/etc'
EOI
echo "kmod busybox base-files " \
| sed -e "s/\s/ ipkg\n/g" | opkg uci ignore
}
opkg_uci() {
local OPKG_OPT="${1:-${OPKG_UCI}}"
local OPKG_OPT="${OPKG_OPT:-auto}"
if ! uci -q get opkg.defaults > /dev/null
then opkg init
fi
uci -q batch << EOI
delete opkg.'${OPKG_OPT}'
set opkg.'${OPKG_OPT}'='opkg'
$(sed -r -e "s/^(.*)\s(.*)$/\
del_list opkg.'${OPKG_OPT}'.'\2'='\1'\n\
add_list opkg.'${OPKG_OPT}'.'\2'='\1'/")
commit opkg
EOI
}
opkg_import() {
local OPKG_OPT="${1:-${OPKG_UCI}}"
if [ -e "${OPKG_OPT}" ]
then sed -n -r -e "s/\s(overlay|unknown)$/\
\tipkg/p" "${OPKG_OPT}" \
| opkg uci auto
fi
}
opkg_save() {
local OPKG_OPT="${1:-${OPKG_UCI}}"
local OPKG_WR="$(opkg export wr)"
local OPKG_WI="$(opkg export wi)"
local OPKG_UR="$(opkg export ur)"
local OPKG_CM="$(opkg export cm)"
local OPKG_UI="$(opkg export ui)"
if uci -q get fstab.rwm > /dev/null \
&& grep -q -e "\s/rwm\s" /etc/mtab
then {
sed -e "s/$/\trpkg/" "${OPKG_WR}"
sed -e "s/$/\tipkg/" "${OPKG_WI}"
} | opkg uci init
fi
{
sed -e "s/$/\trpkg/" "${OPKG_UR}"
sed -e "s/$/\trpkg/" "${OPKG_CM}" | grep "^-" | sed "s/^-//"
sed -e "s/$/\tipkg/" "${OPKG_UI}"
sed -e "s/$/\tipkg/" "${OPKG_CM}" | grep "^[^-]"
} | opkg uci "${OPKG_OPT}"
rm -f "${OPKG_WR}" "${OPKG_WI}" "${OPKG_UR}" "${OPKG_UI}"
}
opkg_restore() {
local OPKG_OPT="${1:-${OPKG_UCI}}"
local OPKG_CONF="${OPKG_OPT}"
local OPKG_AI="$(opkg export ai)"
local OPKG_PR="$(opkg export pr)"
local OPKG_PI="$(opkg export pi)"
if ! uci -q get opkg > /dev/null
then opkg init
fi
grep -x -f "${OPKG_AI}" "${OPKG_PR}" \
| opkg proc remove
grep -v -x -f "${OPKG_AI}" "${OPKG_PI}" \
| opkg proc install
rm -f "${OPKG_AI}" "${OPKG_PR}" "${OPKG_PI}"
}
opkg_rollback() {
local OPKG_OPT="${1:-${OPKG_UCI}}"
local OPKG_CONF="${OPKG_OPT}"
local OPKG_UR="$(opkg export ur)"
local OPKG_UI="$(opkg export ui)"
local OPKG_PR="$(opkg export pr)"
local OPKG_PI="$(opkg export pi)"
if uci -q get opkg."${OPKG_CONF}" > /dev/null
then opkg restore "${OPKG_CONF}"
grep -v -x -f "${OPKG_PI}" "${OPKG_UI}" \
| opkg proc remove
grep -v -x -f "${OPKG_PR}" "${OPKG_UR}" \
| opkg proc install
fi
rm -f "${OPKG_UR}" "${OPKG_UI}" "${OPKG_PR}" "${OPKG_PI}"
}
opkg_upgr() {
local OPKG_OPT="${1:-${OPKG_UCI}}"
if ! uci -q get opkg > /dev/null
then opkg init
fi
case "${OPKG_OPT}" in
(ai|oi) opkg_"${OPKG_CMD}"_type ;;
esac | opkg proc upgrade
}
opkg_upgr_type() {
local OPKG_AI="$(opkg export ai)"
local OPKG_OI="$(opkg export oi)"
local OPKG_AU="$(opkg export au)"
case "${OPKG_OPT::1}" in
(a) grep -x -f "${OPKG_AI}" "${OPKG_AU}" ;;
(o) grep -x -f "${OPKG_OI}" "${OPKG_AU}" ;;
esac
rm -f "${OPKG_AI}" "${OPKG_OI}" "${OPKG_AU}"
}
opkg_export() {
local OPKG_OPT="${1:-${OPKG_UCI}}"
local OPKG_TEMP="$(mktemp -t opkg.XXXXXX)"
case "${OPKG_OPT}" in
(ai|au) opkg_"${OPKG_CMD}"_cmd ;;
(ri|wr|wi|or|oi) opkg_"${OPKG_CMD}"_type ;;
(ur|ui) opkg_"${OPKG_CMD}"_run ;;
(pr|pi|ig|cm) opkg_"${OPKG_CMD}"_uci ;;
esac > "${OPKG_TEMP}"
echo "${OPKG_TEMP}"
}
opkg_export_cmd() {
local OPKG_TYPE
local OPKG_IG="$(opkg export ig)"
case "${OPKG_OPT:1}" in
(i) OPKG_TYPE="installed";opkg list-"${OPKG_TYPE}" | sed -e "s/\s.*$//" ;;
(u) OPKG_TYPE="upgradable";opkg list-"${OPKG_TYPE}" | sed -e "s/\s.*$//" | grep -v -f "${OPKG_IG}" ;;
esac
}
opkg_export_type() {
local OPKG_INFO="/usr/lib/opkg/info"
local OPKG_TYPE
case "${OPKG_OPT::1}" in
(r) OPKG_INFO="/rom${OPKG_INFO}" ;;
(w) OPKG_INFO="/rwm/upper${OPKG_INFO}" ;;
(o) OPKG_INFO="/overlay/upper${OPKG_INFO}" ;;
esac
case "${OPKG_OPT:1}" in
(r) OPKG_TYPE="c" ;;
(i) OPKG_TYPE="f" ;;
esac
find "${OPKG_INFO}" -name "*.control" \
-type "${OPKG_TYPE}" 2> /dev/null \
| sed -e "s/^.*\///;s/\.control$//"
}
opkg_export_run() {
local OPKG_AI="$(opkg export ai)"
local OPKG_RI="$(opkg export ri)"
case "${OPKG_OPT:1}" in
(r) grep -v -x -f "${OPKG_AI}" "${OPKG_RI}" ;;
(i) grep -v -x -f "${OPKG_RI}" "${OPKG_AI}" ;;
esac
rm -f "${OPKG_AI}" "${OPKG_RI}"
}
opkg_export_uci() {
local OPKG_TYPE
case "${OPKG_OPT:1}" in
(r) OPKG_TYPE="rpkg"; OPKG_CONF="auto" ;;
(i) OPKG_TYPE="ipkg"; OPKG_CONF="auto" ;;
(g) OPKG_TYPE="ipkg"; OPKG_CONF="ignore" ;;
(m) OPKG_TYPE="ipkg"; OPKG_CONF="custom" ;;
esac
uci -q get opkg."${OPKG_CONF}"."${OPKG_TYPE}" \
| sed -e "s/\s/\n/g"
}
opkg_proc() {
local OPKG_OPT="${OPKG_UCI}"
local OPKG_CMD="${1:?}"
local OPKG_PKG
while read -r OPKG_PKG
do opkg "${OPKG_CMD}" "${OPKG_PKG}" ${OPKG_OPT}
done
}
opkg_reinstall() {
local OPKG_OPT="${OPKG_UCI}"
opkg install "${@}" ${OPKG_OPT}
}
opkg_newconf() {
local OPKG_OPT="${1:-${OPKG_UCI}}"
find "${OPKG_OPT}" -name "*-opkg"
}

View File

@ -1,9 +0,0 @@
rm -rf /tmp/luci-modulecache /tmp/luci-indexcache*
grep -q "opkg-upgrade" /etc/crontabs/root || {
hour="$(grep -m1 -ao '[4-6]' /dev/urandom | head -n1)"
min="$(grep -m1 -ao '[0-5][0-9]' /dev/urandom | head -n1)"
echo "$min $hour * * * . /etc/hotplug.d/online/51-opkg-upgrade" >> /etc/crontabs/root
}
exit 0

View File

@ -1,52 +0,0 @@
#
# Copyright (C) 2010-2011 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=my-default-settings
PKG_VERSION:=1
PKG_RELEASE:=80
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=luci
CATEGORY:=LuCI
TITLE:=Default Settings
MAINTAINER:=Kiddin'
PKGARCH:=all
DEPENDS:=+luci-base
endef
define Package/$(PKG_NAME)/conffiles
/etc/config/
/etc/nginx/
endef
define Build/Prepare
chmod -R +x ./files/bin ./files/sbin ./files/etc/profile.d ./files/etc/rc.d ./files/usr/share target/*/{*,}/base-files/{etc/init.d,usr/bin} >/dev/null || true
endef
define Build/Compile
endef
define Package/$(PKG_NAME)/install
$(CP) ./files/* $(1)/
echo $(BOARD)$(TARGETID)
if [ -d ./target/$(BOARD)/base-files/. ]; then \
$(CP) ./target/$(BOARD)/base-files/* $(1)/; \
fi
if [ -d ./target/$(TARGETID)/base-files/. ]; then \
$(CP) ./target/$(TARGETID)/base-files/* $(1)/; \
fi; \
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n
po2lmo ./po/zh_Hans/default.po $(1)/usr/lib/lua/luci/i18n/default.zh-cn.lmo
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@ -1,3 +0,0 @@
config status
option version '0'
option base '1'

View File

@ -1,27 +0,0 @@
config main global
option uci_enable 'true'
config server '_lan'
list listen '80 default_server'
list listen '[::]:80 default_server'
option server_name 'op'
list include 'conf.d/*.locations'
option access_log 'off; # logd openwrt'
config server '_ssl'
list listen '443 ssl'
list listen '[::]:443 ssl'
option server_name '_ssl'
list include 'conf.d/*.locations'
option ssl_certificate '/etc/nginx/conf.d/_lan.crt'
option ssl_certificate_key '/etc/nginx/conf.d/_lan.key'
option ssl_session_cache 'shared:SSL:32k'
option ssl_session_timeout '64m'
option access_log 'off; # logd openwrt'
#config server '_redirect2ssl'
#list listen '80'
#list listen '[::]:80'
#option server_name '_redirect2ssl'
#option return '302 https://$host$request_uri'

View File

@ -1,13 +0,0 @@
-----BEGIN CERTIFICATE-----
MIICBjCCAYugAwIBAgIUGK/jDVgfzEjdhGT3KL8IgfeaQSowCgYIKoZIzj0EAwIw
ZDELMAkGA1UEBhMCWloxEjAQBgNVBAgMCVNvbWV3aGVyZTENMAsGA1UEBwwETm9u
ZTEQMA4GA1UEAwwHT3BlbldydDEgMB4GA1UECgwXT3BlbldydEQyMEEyRUJGREM3
QjM2MDMwHhcNMjEwODMwMDgwMTA3WhcNMjQxMTMwMDgwMTA3WjBkMQswCQYDVQQG
EwJaWjESMBAGA1UECAwJU29tZXdoZXJlMQ0wCwYDVQQHDAROb25lMRAwDgYDVQQD
DAdPcGVuV3J0MSAwHgYDVQQKDBdPcGVuV3J0RDIwQTJFQkZEQzdCMzYwMzB2MBAG
ByqGSM49AgEGBSuBBAAiA2IABNw+4uMTosAzmSJ8o07mhGQlnV0MPLKAKoeFL3/f
MKkNHV4GzqomRA3zx62n8GZhUDTPTyP4Ywso9ns2Z/OP0paC2yBj+EQrdGP5e1r/
UV2mjNL4JR5OCyUSVjGnYDBVRzAKBggqhkjOPQQDAgNpADBmAjEAhcVcQmeBdTFG
nykE8XDCt5NSzwawJms6i7PnTJ3I+c7u1vn6sVpoL+nxAZoCU59jAjEAnPzHfNbv
xGOuPJO3z/BPPDm9rDTX3cTNrfqsWZKndoFxqDr+UdZtk0wXdYW5Ylww
-----END CERTIFICATE-----

View File

@ -1,6 +0,0 @@
-----BEGIN EC PRIVATE KEY-----
MIGkAgEBBDD8iUe1wMW2VINd9hlJqH9Nc5J4MBSCEk3KeXsC4fBOR+ubHEM2K9+I
aY+TWJsMfV6gBwYFK4EEACKhZANiAATcPuLjE6LAM5kifKNO5oRkJZ1dDDyygCqH
hS9/3zCpDR1eBs6qJkQN88etp/BmYVA0z08j+GMLKPZ7Nmfzj9KWgtsgY/hEK3Rj
+Xta/1FdpozS+CUeTgslElYxp2AwVUc=
-----END EC PRIVATE KEY-----

View File

@ -1,53 +0,0 @@
# AdguardHome
server {
listen 80;
listen [::]:80;
server_name adg;
location /{
set $ip 10.0.0.1;
proxy_pass $scheme://$ip:3000;
}
}
# 青龙
server {
listen 80;
listen [::]:80;
server_name ql;
location /{
set $ip 10.0.0.1;
proxy_pass $scheme://$ip:5700;
}
}
# Bypass
server {
listen 80;
listen [::]:80;
server_name by;
return 301 $scheme://op/luci/admin/services/bypass;
}
# Packages软件包
server {
listen 80;
listen [::]:80;
server_name pk;
return 301 $scheme://op/luci/admin/system/opkg;
}
# Upgrade在线固件更新
server {
listen 80;
listen [::]:80;
server_name ug;
return 301 $scheme://op/luci/admin/services/gpsysupgrade;
}
# AriaNg
server {
listen 80;
listen [::]:80;
server_name ag;
return 301 $scheme://op/ariang;
}

View File

@ -1,42 +0,0 @@
server
{
listen 8877;
#listen 443 ssl http2;
server_name _lan;
index index.html index.htm index.php default.html default.htm default.php;
root /data;
# ssl_certificate /etc/acme/supes.top/fullchain.cer;
# ssl_certificate_key /etc/acme/supes.top/supes.top.key;
# ssl_session_timeout '64m';
# ssl_protocols TLSv1.2 TLSv1.3;
# ssl_prefer_server_ciphers on;
# ssl_ciphers "TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5";
# ssl_session_cache 'shared:SSL:10m';
client_max_body_size 0;
location / {
set $dest $http_destination;
if (-d $request_filename) {
rewrite ^(.*[^/])$ $1/;
set $dest $dest/;
}
if ($request_method ~ (MOVE|COPY)) {
more_set_input_headers 'Destination: $dest';
}
if ($request_method ~ MKCOL) {
rewrite ^(.*[^/])$ $1/ break;
}
dav_methods PUT DELETE MKCOL COPY MOVE;
dav_ext_methods PROPFIND OPTIONS;
dav_access user:rw group:rw all:r;
create_full_put_path on;
auth_basic "Restricted access";
auth_basic_user_file /etc/nginx/htpasswd.conf;
}
}

View File

@ -1 +0,0 @@
root:fU70Nx.37Ofww

View File

@ -1,33 +0,0 @@
# Consider using UCI or creating files in /etc/nginx/conf.d/ for configuration.
# Parsing UCI configuration is skipped if uci set nginx.global.uci_enable=false
# For details see: https://openwrt.org/docs/guide-user/services/webserver/nginx
worker_processes auto;
user root;
events {}
http {
access_log off;
log_format openwrt
'$request_method $scheme://$host$request_uri => $status'
' (${body_bytes_sent}B in ${request_time}s) <- $http_referer';
include mime.types;
default_type application/octet-stream;
sendfile on;
client_max_body_size 2048m;
client_header_buffer_size 512k;
large_client_header_buffers 4 512k;
gzip on;
gzip_vary on;
gzip_proxied any;
root /www;
#UCI_HTTP_CONFIG
include conf.d/*.conf;
}

View File

@ -1,121 +0,0 @@
#!/bin/bash
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export LANG=zh_CN.UTF-8
THIS_SCRIPT="sysinfo"
MOTD_DISABLE=""
SHOW_IP_PATTERN="^[ewr].*|^br.*|^lt.*|^umts.*"
DATA_STORAGE=/userdisk/data
MEDIA_STORAGE=/userdisk/snail
# don't edit below here
function display()
{
# $1=name $2=value $3=red_limit $4=minimal_show_limit $5=unit $6=after $7=acs/desc{
# battery red color is opposite, lower number
if [[ "$1" == "Battery" ]]; then
local great="<";
else
local great=">";
fi
if [[ -n "$2" && "$2" > "0" && (( "${2%.*}" -ge "$4" )) ]]; then
printf "%-14s%s" "$1:"
if awk "BEGIN{exit ! ($2 $great $3)}"; then
echo -ne "\e[0;91m $2";
else
echo -ne "\e[0;92m $2";
fi
printf "%-1s%s\x1B[0m" "$5"
printf "%-11s%s\t" "$6"
return 1
fi
} # display
function get_ip_addresses()
{
local ips=()
for f in /sys/class/net/*; do
local intf=$(basename $f)
# match only interface names starting with e (Ethernet), br (bridge), w (wireless), r (some Ralink drivers use ra<number> format)
if [[ $intf =~ $SHOW_IP_PATTERN ]]; then
local tmp=$(ip -4 addr show dev $intf | awk '/inet/ {print $2}' | cut -d'/' -f1)
# add both name and IP - can be informative but becomes ugly with long persistent/predictable device names
#[[ -n $tmp ]] && ips+=("$intf: $tmp")
# add IP only
[[ -n $tmp ]] && ips+=("$tmp")
fi
done
echo "${ips[@]}"
} # get_ip_addresses
function storage_info()
{
# storage info
RootInfo=$(df -h /)
root_usage=$(awk '/\// {print $(NF-1)}' <<<${RootInfo} | sed 's/%//g')
root_total=$(awk '/\// {print $(NF-4)}' <<<${RootInfo})
} # storage_info
# query various systems and send some stuff to the background for overall faster execution.
# Works only with ambienttemp and batteryinfo since A20 is slow enough :)
storage_info
critical_load=$(( 1 + $(grep -c processor /proc/cpuinfo) / 2 ))
# get uptime, logged in users and load in one take
UptimeString=$(uptime | tr -d ',')
time=$(awk -F" " '{print $3" "$4}' <<<"${UptimeString}")
load="$(awk -F"average: " '{print $2}'<<<"${UptimeString}")"
case ${time} in
1:*) # 1-2 hours
time=$(awk -F" " '{print $3" 小时"}' <<<"${UptimeString}")
;;
*:*) # 2-24 hours
time=$(awk -F" " '{print $3" 小时"}' <<<"${UptimeString}")
;;
*day) # days
days=$(awk -F" " '{print $3"天"}' <<<"${UptimeString}")
time=$(awk -F" " '{print $5}' <<<"${UptimeString}")
time="$days "$(awk -F":" '{print $1"小时 "$2"分钟"}' <<<"${time}")
;;
esac
# memory and swap
mem_info=$(LC_ALL=C free -w 2>/dev/null | grep "^Mem" || LC_ALL=C free | grep "^Mem")
memory_usage=$(awk '{printf("%.0f",(($2-($4+$6))/$2) * 100)}' <<<${mem_info})
memory_total=$(awk '{printf("%d",$2/1024)}' <<<${mem_info})
swap_info=$(LC_ALL=C free -m | grep "^Swap")
swap_usage=$( (awk '/Swap/ { printf("%3.0f", $3/$2*100) }' <<<${swap_info} 2>/dev/null || echo 0) | tr -c -d '[:digit:]')
swap_total=$(awk '{print $(2)}' <<<${swap_info})
c=0
while [ ! -n "$(get_ip_addresses)" ];do
[ $c -eq 3 ] && break || let c++
sleep 1
done
ip_address="$(get_ip_addresses)"
# display info
display "系统负载" "${load%% *}" "${critical_load}" "0" "" "${load#* }"
printf "运行时间: \x1B[92m%s\x1B[0m\t\t" "$time"
echo "" # fixed newline
display "内存已用" "$memory_usage" "70" "0" " %" " of ${memory_total}MB"
display "交换内存" "$swap_usage" "10" "0" " %" " of $swap_total""Mb"
printf "IP 地址: \x1B[92m%s\x1B[0m" "$ip_address"
echo "" # fixed newline
display "系统存储" "$root_usage" "90" "1" "%" " of $root_total"
if [ -x /sbin/cpuinfo ]; then
printf "CPU 信息: \x1B[92m%s\x1B[0m\t" "$(echo `/sbin/cpuinfo | cut -d ' ' -f -4`)"
fi
echo ""
echo ""

View File

@ -1,14 +0,0 @@
#!/bin/sh /etc/rc.common
[[ -f "/bin/coremark" && ! -f "/etc/bench.log" && "$(uci -q get wizard.default.coremark)" == '1' ]] && {
(
sleep 5
while :; do
[ -f /var/lock/opkg.lock ] || {
/sbin/cpumark
break;
}
sleep 1
done
) &
}

View File

@ -1,233 +0,0 @@
#!/bin/sh
([ -x /bin/bash ] && ! grep -q "^root.*bash" /etc/passwd) && sed -i "s/^\(root.*\/\)ash/\1bash/g" /etc/passwd
# [[ "$(df | grep overlay)" && ! "$(df | grep /rom/overlay)" ]] && firstboot
version=`uci -q get base_config.@status[0].version`
hostname=`uci -q get system.@system[0].hostname`
[ -n "${hostname}" ] || hostname="OpenWrt"
if [ "$(uci -q get dhcp.@dnsmasq[0].port)" != "53" ]; then
uci -q set dhcp.@dnsmasq[0].port='53'
uci commit dhcp
fi
uci -q batch <<EOF
set attendedsysupgrade.server.url='https://op.supes.top'
commit attendedsysupgrade
EOF
uci -q set dockerd.firewall.extra_iptables_args='--match conntrack ! --ctstate RELATED,ESTABLISHED'
uci commit dockerd
sed -i '/profile.d/d' /lib/upgrade/keep.d/base-files
echo $(uci -q get uhttpd.main.index_page) | grep -q "cgi-bin/luci" ||
uci -q add_list uhttpd.main.index_page='cgi-bin/luci' && uci commit uhttpd
/etc/init.d/wizard disable
[[ -x /usr/bin/wget && ! -x /usr/bin/wget-ssl ]] &&
ln -s /usr/bin/wget /usr/bin/wget-ssl
sed -i "s/git-.*-\(.*\)/git-\1/g" /usr/lib/lua/luci/version.lua
if [ -f /etc/uwsgi/vassals/luci-webui.ini ]; then
processor=`cat /proc/cpuinfo | grep 'processor' | wc -l`
[ -n "$processor" ] || processor=3
sed -i "/^threads =/c\threads = $processor" /etc/uwsgi/vassals/luci-webui.ini
fi
if [[ ! "$version" || "$version" -lt 1 ]]; then
uci -q set luci.main.lang='auto'
uci -q set luci.main.mediaurlbase=/luci-static/argon
uci commit luci
uci -q set dropbear.@dropbear[0].Interface='lan'
uci commit dropbear
if uci -q get system.@system[0] >/dev/null; then
uci -q set system.@system[0].zonename='Asia/Shanghai'
uci -q set system.@system[0].timezone='CST-8'
uci -q del system.ntp.server
uci -q add_list system.ntp.server='ntp.aliyun.com'
uci -q add_list system.ntp.server='0.openwrt.pool.ntp.org'
uci commit system
fi
uci -q set uhttpd.main.rfc1918_filter=0
uci -q set uhttpd.main.redirect_https=0
uci -q set uhttpd.main.script_timeout='120'
uci commit uhttpd
(echo "root"; sleep 1; echo "root") | /bin/busybox passwd root >/dev/null 2>&1 &
. /etc/openwrt_release
if [[ "$DISTRIB_TARGET" != "x86/64" ]]; then
uci -q set firewall.@defaults[0].flow_offloading='1'
uci -q set firewall.@defaults[0].flow_offloading_hw='1'
uci commit firewall
fi
wifi_setup_radio(){
local radio=$1
htmode="$(uci -q get wireless.${radio}.htmode)"
local widx=0
while uci rename wireless.@wifi-iface[$widx]=default_radio$widx >/dev/null 2>&1; do widx=$((widx+1)); done
if uci -q get wireless.${radio} >/dev/null; then
uci -q del wireless.${radio}.disabled
uci -q set wireless.${radio}.country='US'
if [ "$(uci -q get wireless.${radio}.band)" = "5g" ]; then
uci -q set wireless.default_${radio}.ssid="${SSID}_5G"
if [[ "${htmode}" == HE* ]]; then # AX
if [[ "$(board_name)" == *cr660x || "$(board_name)" == *ax9000 || "$DISTRIB_TARGET" == 'ipq60xx/generic' || "$DISTRIB_TARGET" == 'ipq807x/ipq60xx' ]]; then
uci -q set wireless.${radio}.htmode="HE80"
uci -q set wireless.${radio}.channel='157'
else
uci -q set wireless.${radio}.htmode="HE160"
uci -q set wireless.${radio}.channel='44'
fi
else
uci -q set wireless.${radio}.htmode="VHT80" #AC
uci -q set wireless.${radio}.channel="157"
fi
if [[ "$(board_name)" == *ax6000 ]]; then
uci -q set wireless.${radio}.htmode="VHT160"
fi
else
uci -q set wireless.${radio}.htmode="HT40" #N
uci -q set wireless.${radio}.noscan='1'
uci -q set wireless.${radio}.vendor_vht='1'
uci -q set wireless.default_${radio}.ssid="${SSID}_2.4G"
uci -q set wireless.${radio}.channel='auto'
fi
uci -q set wireless.default_${radio}.device="${radio}"
if [ "${SSID_PASSWD}" ]; then
uci -q set wireless.default_${radio}.encryption='psk2'
uci -q set wireless.default_${radio}.key="${SSID_PASSWD}"
else
uci -q set wireless.default_${radio}.encryption='none'
fi
fi
}
if [ -f /etc/config/wireless ]; then
SSID=${hostname}
SSID_PASSWD=""
[ "$(uci -q get wireless.radio1.band)" == "5g" ] && uci -q set wireless.radio0.band="2g"
for radio in radio0 radio1 radio2 radio3; do
wifi_setup_radio ${radio}
done
uci commit wireless
fi
uci -q set upnpd.config.enabled='1'
uci commit upnpd
grep -q log-facility /etc/dnsmasq.conf ||
echo "log-facility=/dev/null" >> /etc/dnsmasq.conf
kernel_version="$(echo -n $(uname -r))"
if [[ -f /lib/modules/$kernel_version/xt_FULLCONENAT.ko || -f /lib/modules/$kernel_version/nft_fullcone.ko ]]; then
uci -q set firewall.@defaults[0].fullcone='1'
uci commit firewall
fi
uci -q set fstab.@global[0].anon_mount=1
uci commit fstab
uci -q set network.@globals[0].packet_steering=1
uci commit network
uci -q set dhcp.@dnsmasq[0].dns_redirect='1'
uci -q set dhcp.@dnsmasq[0].allservers='1'
uci -q del dhcp.@dnsmasq[0].noresolv
uci -q set dhcp.@dnsmasq[0].cachesize='1500'
uci -q set dhcp.@dnsmasq[0].min_ttl='3600'
uci -q set dhcp.lan.force='1'
uci -q set dhcp.lan.ra='hybrid'
uci -q set dhcp.lan.ndp='hybrid'
uci -q set dhcp.lan.dhcpv6='hybrid'
uci -q set dhcp.lan.force='1'
uci commit dhcp
uci -q set nft-qos.default.limit_enable='0'
uci commit nft-qos
uci -q set system.@system[0].conloglevel='4'
uci -q set system.@system[0].cronloglevel='8'
uci commit system
fi
# kB
memtotal=`grep MemTotal /proc/meminfo | awk '{print $2}'`
if [ "$memtotal" -ge 1048576 ]; then
# > 1024M
cachesize=10000
dnsforwardmax=10000
nf_conntrack_max=262144
elif [ "$memtotal" -ge 524288 ]; then
# <= 1024M
cachesize=10000
dnsforwardmax=10000
nf_conntrack_max=131072
elif [ "$memtotal" -ge 262144 ]; then
# <= 512M
cachesize=8192
dnsforwardmax=8192
nf_conntrack_max=65536
elif [ "$memtotal" -ge 131072 ]; then
# <= 256M
cachesize=4096
dnsforwardmax=4096
nf_conntrack_max=65536
elif [ "$memtotal" -ge 65536 ]; then
# <= 128M
cachesize=2048
dnsforwardmax=2048
nf_conntrack_max=32768
else
# < 64M
cachesize=1024
dnsforwardmax=1024
nf_conntrack_max=16384
fi
if [[ ! "$version" || "$version" -lt 1 ]]; then
uci -q get dhcp.@dnsmasq[0] || uci -q add dhcp dnsmasq
uci -q set dhcp.@dnsmasq[0].cachesize="$cachesize"
uci -q set dhcp.@dnsmasq[0].dnsforwardmax="$dnsforwardmax"
uci -q set dhcp.@dnsmasq[0].localservice='0'
uci -q set dhcp.@dnsmasq[0].localise_queries='1'
uci -q set dhcp.@dnsmasq[0].rebind_protection='0'
uci -q set dhcp.@dnsmasq[0].rebind_localhost='1'
uci commit dhcp
uci -q set system.@system[0].zram_comp_algo='zstd'
uci -q set system.@system[0].zram_size_mb="$(expr $memtotal / 1024 / 3)"
uci commit system
# sysctl overwrite
SYSCTL_LOCAL=/etc/sysctl.d/50-local.conf
mkdir -p /etc/sysctl.d
echo -n >$SYSCTL_LOCAL
echo net.nf_conntrack_max=$nf_conntrack_max >>$SYSCTL_LOCAL
echo net.ipv4.ip_early_demux=0 >>$SYSCTL_LOCAL
echo net.bridge.bridge-nf-call-iptables=0 >>$SYSCTL_LOCAL
echo net.ipv4.fib_multipath_hash_policy=1 >>$SYSCTL_LOCAL
echo net.ipv4.tcp_congestion_control=cubic >>$SYSCTL_LOCAL
echo net.netfilter.nf_conntrack_helper=1 >>$SYSCTL_LOCAL
echo kernel.msgmax = 65536 >>$SYSCTL_LOCAL
echo kernel.msgmnb = 65536 >>$SYSCTL_LOCAL
echo vm.swappiness=0 >>$SYSCTL_LOCAL
version=1
fi
cp -pR /www/cgi-bin/* /www/
rm -rf /tmp/luci-*
uci -q set base_config.@status[0].version=$version
uci commit base_config

View File

@ -1,3 +0,0 @@
#!/bin/ash
/bin/coremark | grep "CoreMark 1.0" | cut -d "/" -f 1 | cut -d "." -f -2 | sed -e 's/CoreMark 1.0\(.*\)/(CpuMark\1 Scores)/g' | tee /etc/bench.log

View File

@ -1,68 +0,0 @@
#!/bin/ash
# 默认使用关机命令
ACTION="poweroff"
# 获取shutdown参数
# Qemu-GA 默认调用 -h -P +0的方式
while [ -n "$1" ]; do
case "$1" in
-r)
ACTION="reboot"
shift
;;
-k)
ACTION="warning"
shift
;;
-h|-H)
ACTION="halt"
shift
;;
-n)
ACTION="poweroff"
shift
;;
-c)
echo "Cancel shutdown, but not support the Openwrt!" > /dev/kmsg
ACTION="stop"
shift
;;
-p|-P)
ACTION="poweroff"
shift
;;
-*)
shift
;;
*)
break
;;
esac
done
if [ $# == 0 ]; then
echo "Shutting down without any params" > /dev/kmsg
/sbin/poweroff
elif [ "$ACTION" = "poweroff" ]; then
/sbin/poweroff;
elif [ "$ACTION" = "reboot" ]; then
/sbin/reboot
elif [ "$ACTION" = "warning" ]; then
echo "关机警告">/dev/kmsg
/sbin/poweroff;
elif [ "$ACTION" = "halt" ]; then
/sbin/halt
fi

View File

@ -1,14 +0,0 @@
<% if luci.sys.exec("echo -n `uci -q get base_config.@status[0].links`") ~= "0" then %>
<script>
var links = document.createElement('div');
links.innerHTML ='<div class="table"><div class="tr"><div class="td left"><a href="https://supes.top/" target="_blank">固件下载与定制</a></div><div class="td left" width="25%"><a href="https://supes.top/fadian/" target="_blank" style="color:orangered">赞助</a></div><div class="td left" width="25%"><a href="https://t.me/opwrt" target="_blank">TG频道</a></div><div class="td left" width="25%"><a href="https://github.com/kiddin9/OpenWrt_x86-r2s-r4s" target="_blank">源码与反馈</a></div></div></div>';
setTimeout(function(){
var telegram = document.querySelectorAll(".cbi-section")[0];
telegram.appendChild(links);
}, 1500);
setTimeout(function(){
var telegram = document.querySelectorAll(".cbi-section")[0];
telegram.appendChild(links);
}, 2400);
</script>
<%end%>

View File

@ -1,172 +0,0 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2021-04-12 14:21+0000\n"
"Language: zh_Hans\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 4.5-dev\n"
msgid "Processor"
msgstr "处理器"
msgid "Architecture"
msgstr "架构"
msgid "CPU Temperature"
msgstr "CPU 温度"
msgid "CPU Info"
msgstr "CPU 信息"
msgid "CPU Model"
msgstr "处理器型号"
msgid "CPU frequency"
msgstr "CPU 频率"
msgid "RAM frequency"
msgstr "RAM 频率"
msgid "Flash Size"
msgstr "闪存大小"
msgid "Free Memory"
msgstr "释放内存"
msgid "RUNNING"
msgstr "运行中"
msgid "NOT RUNNING"
msgstr "未运行"
msgid "ZRam Settings"
msgstr "ZRam 设置"
msgid "ZRam Compression Algorithm"
msgstr "ZRam 压缩算法"
msgid "ZRam Compression Streams"
msgstr "ZRam 压缩数据流线程数"
msgid "ZRam Size"
msgstr "ZRam 大小"
msgid "Size of the ZRam device in megabytes"
msgstr "划分给 ZRam 分区的内存大小MB推荐留空由系统自动管理"
msgid "Number of parallel threads used for compression"
msgstr "用于压缩内存数据的CPU并发线程数"
msgid "Swap"
msgstr "虚拟内存"
msgid "Swap used"
msgstr "已用交换区"
msgid "Force 40MHz mode"
msgstr "强制 40MHz 频宽"
msgid ""
"Always use 40MHz channels even if the secondary channel overlaps. Using this "
"option does not comply with IEEE 802.11n-2009!"
msgstr "强制启用 40MHz 频宽并忽略辅助信道重叠。此选项可能不兼容某些无线硬件导致无法启用!"
msgid "Disassociate On Low Acknowledgement"
msgstr "弱信号剔除"
msgid "Allow AP mode to disconnect STAs based on low ACK condition"
msgstr "允许 AP 模式基于低 ACK 条件判断剔除弱信号的客户端"
msgid "Running Status"
msgstr "运行状况"
msgid "Online Users"
msgstr "在线用户数"
msgid "DNS Redirect"
msgstr "DNS 重定向"
msgid "Redirect client DNS to dnsmasq"
msgstr "重定向客户端DNS到dnsmasq"
msgid "Enable 256-QAM"
msgstr "启用 256-QAM"
msgid "802.11n 2.4Ghz Only"
msgstr "只适合 802.11n 2.4Ghz"
msgid "Enables The 802.11k standard provides information to discover the best available access point"
msgstr "启用 802.11k 自动寻找发现最佳可用接入点的信息"
msgid "Enable neighbor report via radio measurements"
msgstr "启用无线电测量邻居报告"
msgid "Enable beacon report via radio measurements"
msgstr "启用无线电测量信标报告"
msgid "Enables 802.11v allows client devices to exchange information about the network topology,tating overall improvement of the wireless network."
msgstr "启用 802.11v 将允许客户端设备交换有关网络拓扑的信息,从而全面改善无线网络漫游"
msgid "extended sleep mode for stations"
msgstr "扩展无线休眠节能模式"
msgid "BSS Transition Management"
msgstr "BSS 传输管理"
msgid "UTC time at which the TSF timer is 0"
msgstr "TSF计时器为0的UTC时间"
msgid "Time advertisement"
msgstr "广播同步时间"
msgid "time zone"
msgstr "时区"
msgid "Local time zone as specified in 8.3 of IEEE Std 1003.1-2004"
msgstr "本地时区采用 IEEE Std 1003.1-2004 的 8.3 格式(例如 UTC8"
msgid "Custom Redirect Domain"
msgstr "自定义挟持域名"
msgid "Define a custom domain name and the corresponding PTR record"
msgstr "自定义域名对应的IP地址需要客户端DNS指向本路由"
msgid "Domain Name"
msgstr "域名(不带 HTTP(S)://"
msgid "Comments"
msgstr "备注"
msgid "Packet Steering"
msgstr "数据包引导"
msgid "Enable packet steering across all CPUs. May help or hinder network speed."
msgstr "启用所有CPU的数据包控制。 可能有助于或阻碍网络速度。"
msgid "Disable IPv6 DNS forwards"
msgstr "禁止解析 IPv6 DNS 记录"
msgid "Filter IPv6(AAAA) DNS Query Name Resolve"
msgstr "过滤掉 IPv6(AAAA) ,只返回 IPv4 DNS 域名记录"
msgid "Minimum TTL to send to clients"
msgstr "客户端缓存的最小 DNS TTL"
msgid "Modify DNS entries minimum TTL (max is 86400, 0 is no modify)"
msgstr "修改发送到客户端的域名记录的 TTL 时间 (最大 86400, 0 表示不修改)"
msgid "FullCone NAT"
msgstr "全锥形 NAT"
msgid "Using FullCone NAT can improve gaming performance effectively"
msgstr "使用全锥形 NAT 可以有效提升游戏体验"
msgid "Used space"
msgstr "已用空间"
msgid "Upgrade all…"
msgstr "更新所有软件包 (谨慎)"
msgid "Temperature"
msgstr "温度"

View File

@ -1,12 +0,0 @@
#!/bin/sh
ETHTOOL=/usr/sbin/ethtool
$ETHTOOL -i eth0 | grep r8152 && \
[ "$ACTION" = "ifup" ] && \
$ETHTOOL -K eth0 rx off tx off
$ETHTOOL -i eth1 | grep r8152 && \
[ "$ACTION" = "ifup" ] && \
$ETHTOOL -K eth1 rx off tx off

View File

@ -1,39 +0,0 @@
#
# Copyright © 2017 OpenWrt.org
#
. /lib/functions/system.sh
. /lib/functions/uci-defaults.sh
board_config_update
case "$(board_name)" in
pc-engines-apu1|pc-engines-apu2|pc-engines-apu3)
ucidef_set_interfaces_lan_wan "eth1 eth2" "eth0"
;;
roqos-roqos-core-rc10)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
;;
brounion-r86s)
ucidef_set_interfaces_lan_wan "eth1 eth2" "eth0"
;;
ikoolcore-r1)
ucidef_set_interfaces_lan_wan "eth1 eth2 eth3" "eth0"
;;
sophos-sg-105|sophos-xg-105)
ucidef_set_interfaces_lan_wan "eth0 eth2 eth3" "eth1"
;;
traverse-technologies-geos)
ucidef_set_interface_lan "eth0 eth1"
ucidef_add_atm_bridge "0" "35" "llc" "bridged"
ucidef_set_interface_wan "nas0" "dhcp"
macaddr="$(cat /sys/class/net/eth0/address)" 2>/dev/null
[ -n "$macaddr" ] && ucidef_set_interface_macaddr "wan" "$macaddr"
;;
xiaoma-m12)
ucidef_set_interfaces_lan_wan "eth1 eth2 eth3 eth4 eth5 eth6" "eth0"
;;
esac
board_config_flush
exit 0

View File

@ -1,278 +0,0 @@
<% local raid = {}
local devs = {}
local devinfo = {}
local colors = { "c0c0ff", "fbbd00", "e97c30", "a0e0a0", "e0c0ff" }
local mounts = nixio.fs.readfile("/proc/mounts")
local show_raid = 1
local show_disc = 1
if self then
if self.hide_raid then
show_raid = 0
end
if self.hide_disc then
show_disc = 0
end
end
function disp_size(s)
local units = { "kB", "MB", "GB", "TB" }
local i, unit
s = s / 2
for i, unit in ipairs(units) do
if (i == #units) or (s < 1024) then
return math.floor(s * 100) / 100 .. unit
end
s = s / 1024
end
end
function first_line(s)
local n = s:find("\n")
if n then
return s:sub(1, n-1)
end
return s
end
function get_fs(pname, status)
for r,raid in ipairs(raid) do
for m,member in ipairs(raid.members) do
if member.name == pname then
return "(raid member)"
end
end
end
local mounted_fs = mounts:match("\n[a-z/]*" .. pname .. " [^ ]* ([^ ]*)")
if mounted_fs then
if status == "standby" then
return "(" .. mounted_fs .. ")"
end
local df = luci.sys.exec("df /dev/" .. pname):match(" ([0-9]+)%% ")
return "(" .. mounted_fs .. " " .. df .. "%)"
end
if status == "standby" then
return
end
local blkid = luci.sys.exec(" blkid -s TYPE /dev/" .. pname):match("TYPE=\"(.*)\"")
if blkid then
return "(" .. blkid .. ")"
end
end
function get_status(raid)
for m,member in ipairs(raid.members) do
for d,dev in ipairs(devinfo) do
if member.name == dev.name then
return dev.status
end
for p,part in ipairs(dev.parts) do
if member.name == part.name then
return dev.status
end
end
end
end
end
function get_parts(dev,status,size)
local c = 1
local unused = size
local parts = {}
for part in nixio.fs.glob("/sys/block/" .. dev .."/" .. dev .. "*") do
local pname = nixio.fs.basename(part)
local psize = nixio.fs.readfile(part .. "/size")
table.insert(parts, {name=pname, size=psize, perc=math.floor(psize*100/size), fs=get_fs(pname,status), color=colors[c]})
c = c + 1
unused = unused - psize
end
if unused > 2048 then
table.insert(parts, { name="", fs=get_fs(dev,status), size=unused, color=colors[c] })
end
return parts
end
for dev in nixio.fs.glob("/sys/block/*") do
if nixio.fs.access(dev .. "/md") then
local name = nixio.fs.basename(dev)
local rlevel = first_line(nixio.fs.readfile(dev .. "/md/level"))
local ndisks = tonumber(nixio.fs.readfile(dev .. "/md/raid_disks"))
local size = tonumber(nixio.fs.readfile(dev .. "/size"))
local metav = nixio.fs.readfile(dev .. "/md/metadata_version")
local degr = tonumber(nixio.fs.readfile(dev .. "/md/degraded"))
local sync = first_line(nixio.fs.readfile(dev .. "/md/sync_action"))
local sync_speed = tonumber(nixio.fs.readfile(dev .. "/md/sync_speed"))
local sync_compl = nixio.fs.readfile(dev .. "/md/sync_completed")
local status = "active"
if sync ~= "idle" then
local progress, total = nixio.fs.readfile(dev .. "/md/sync_completed"):match("^([0-9]*)[^0-9]*([0-9]*)")
local rem = (total - progress) / sync_speed / 2
local rems = math.floor(rem % 60)
if rems < 10 then rems = "0" .. rems end
rem = math.floor(rem / 60)
local remm = math.floor(rem % 60)
if remm < 10 then remm = "0" .. remm end
local remh = math.floor(rem / 60)
local remstr = remh .. ":" .. remm .. ":" .. rems
status = sync .. " (" .. math.floor(sync_speed/1024) .. "MB/s, " .. math.floor(progress * 1000 / total) /10 .. "%, rem. " .. remstr .. ")"
elseif degr == 1 then
status = "degraded"
end
local members = {}
local c = 1
for member in nixio.fs.glob("/sys/block/" .. name .. "/md/dev-*") do
local dname = nixio.fs.basename(nixio.fs.readlink(member .. "/block"))
local dsize = disp_size(tonumber(nixio.fs.readfile(member .. "/block/size")))
local dstate = nixio.fs.readfile(member .. "/state"):gsub("_", " "):match "^%s*(.-)%s*$"
table.insert(members, { name = dname, size = dsize, state = dstate, color = colors[c] })
c = c + 1
end
table.insert(raid, {name=name, rlevel=rlevel, ndisks=ndisks, size=size, metav=metav, status=status, members=members })
end
end
if show_disc == 1 then
for dev in nixio.fs.glob("/sys/class/scsi_disk/*/device") do
local section
local model = nixio.fs.readfile(dev .. "/model")
local fw = nixio.fs.readfile(dev .. "/rev")
for bdev in nixio.fs.glob(dev .. "/block/*") do
local section
local name = nixio.fs.basename(bdev)
local size = tonumber(nixio.fs.readfile(bdev .. "/size"))
local unused = size
local status = "-"
local temp = "-"
local serial = "-"
local secsize = "-"
for _,line in ipairs(luci.util.execl("smartctl -A -i -n standby -f brief /dev/" .. name)) do
local attrib, val
if section == 1 then
attrib, val = line:match "^(.*):%s*(.*)"
elseif section == 2 then
attrib, val = line:match("^([0-9 ]*) [^ ]* * [POSRCK-]* *[0-9-]* *[0-9-]* *[0-9-]* *[0-9-]* *([0-9-]*)")
else
attrib = line:match "^=== START OF (.*) SECTION ==="
if attrib == "INFORMATION" then
section = 1
elseif attrib == "READ SMART DATA" then
section = 2
elseif status == "-" then
val = line:match "^Device is in (.*) mode"
if val then
status = val:lower()
end
end
end
if not attrib then
if section ~= 2 then section = 0 end
elseif (attrib == "Power mode is") or (attrib == "Power mode was") then
status = val:lower():match "(%S*)"
elseif attrib == "Sector Sizes" then
secsize = val:match "([0-9]*) bytes physical"
elseif attrib == "Sector Size" then
secsize = val:match "([0-9]*)"
elseif attrib == "Serial Number" then
serial = val
elseif attrib == "194" then
temp = val .. "&deg;C"
end
end
table.insert(devinfo, {name=name, model=model, fw=fw, size=size, status=status, temp=temp, serial=serial, secsize=secsize, parts=get_parts(name,status,size) })
end
end
for r,dev in ipairs(raid) do
table.insert(devinfo, {name=dev.name, model="Linux RAID", size=dev.size, status=get_status(dev), secsize=secsize, parts=get_parts(dev.name,status,dev.size) })
end
end
if show_disc == 1 then %>
<div class="cbi-section">
<h3><%:Disks%></h3>
<table class="cbi-section-table" style="white-space: nowrap">
<tr>
<th width="5%">&nbsp;</th>
<th width="30%"><%:Model%></th>
<th width="15%"><%:Serial number%></th>
<th width="10%"><%:Firmware%></th>
<th width="10%"><%:Capacity%></th>
<th width="5%"><%:Sector size%></th>
<th width="5%"><%:Temperature%></th>
<th width="20%"><%:Power state%></th>
</tr>
<% local style=true
for d,dev in ipairs(devinfo) do %>
<tr class="cbi-section-table-row cbi-rowstyle-<%=(style and 1 or 2)%>">
<td class="cbi-vluae-field" style="padding-bottom:0px; border-bottom-width:0px; vertical-align:middle" rowspan="4"><%=dev.name%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=dev.model%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=dev.serial%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=dev.fw%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=disp_size(dev.size)%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=dev.secsize%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=dev.temp%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=dev.status%></td>
</tr>
<tr style="height:0px" />
<tr class="cbi-section-table-row cbi-rowstyle-<%=(style and 1 or 2)%>">
<td style="padding:0px; border-top-width:0px;" colspan="7" rowspan="2">
<table style="border: 0pt; border-collapse:collapse; width:100%; padding:0px; margin:0px"><tr>
<% for _,part in pairs(dev.parts) do %>
<td style="text-align:center; padding: 0px 4px; border-radius: 3px; background-color:#<%=part.color%>" width="<%=part.perc%>%"><%=part.name%> <%=disp_size(part.size)%> <%=part.fs%></td>
<% end %>
</tr></table>
</td>
</tr>
<tr style="height:0px" />
<% style = not style
end %>
</table>
</div>
<% end
if show_raid == 1 and #raid > 0 then %>
<div class="cbi-section">
<h3><%:Raid arrays%></h3>
<table class="cbi-section-table" style="white-space:nowrap">
<tr>
<th width="5%">&nbsp;</th>
<th width="13%"><%:Level%></th>
<th width="13%"><%:# Disks%></th>
<th width="13%"><%:Capacity%></th>
<th width="13%"><%:Metadata%></th>
<th width="43%"><%:Status%></th>
</tr>
<% local style=true
for r,dev in ipairs(raid) do %>
<tr class="cbi-section-table-row cbi-rowstyle-<%=(style and 1 or 2)%>">
<td class="cbi-vluae-field" style="padding-bottom:0px; border-bottom-width:0px; vertical-align:middle" rowspan="4"><%=dev.name%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=dev.rlevel%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=dev.ndisks%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=disp_size(dev.size)%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=dev.metav%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=dev.status%></td>
</tr>
<tr style="height:0px" />
<tr class="cbi-section-table-row cbi-rowstyle-<%=(style and 1 or 2)%>">
<td style="padding-top:0px; border-top-width:0px" colspan="6" rowspan="2">
<table style="border: 0pt; border-collapse:collapse; width:100%; padding:0px; margin:0px"><tr>
<% for _,member in pairs(dev.members) do %>
<td style="text-align:center; padding: 0px 4px; border-radius: 3px; background-color:#<%=member.color%>; white-space: nowrap"><%=member.name%> <%=member.size%> (<%=member.state%>)</td>
<% end %>
</tr></table>
</td>
</tr>
<tr style="height:0px" />
<% style = not style
end %>
</table>
</div>
<% end %>

View File

@ -1,228 +0,0 @@
<% local raid = {}
local devs = {}
local devinfo = {}
local colors = { "c0c0ff", "fbbd00", "e97c30", "a0e0a0", "b2c005", "e0c0ff" }
local mounts = nixio.fs.readfile("/proc/mounts")
local show_raid = 1
local show_disc = 1
if self then
if self.hide_raid then
show_raid = 0
end
if self.hide_disc then
show_disc = 0
end
end
function disp_size(s)
local units = { "kB", "MB", "GB", "TB" }
local i, unit
s = s / 2
for i, unit in ipairs(units) do
if (i == #units) or (s < 1024) then
return math.floor(s * 100) / 100 .. unit
end
s = s / 1024
end
end
function first_line(s)
local n = s:find("\n")
if n then
return s:sub(1, n-1)
end
return s
end
function get_fs(pname, status)
for r,raid in ipairs(raid) do
for m,member in ipairs(raid.members) do
if member.name == pname then
return "(raid member)"
end
end
end
local mounted_fs = mounts:match("\n[a-z/]*" .. pname .. " [^ ]* ([^ ]*)")
if mounted_fs then
if status == "standby" then
return "(" .. mounted_fs .. ")"
end
local df = luci.sys.exec("df /dev/" .. pname):match(" ([0-9]+)%% ")
return "(" .. mounted_fs .. " " .. df .. "%)"
end
if status == "standby" then
return
end
local blkid = luci.sys.exec(" blkid -s TYPE /dev/" .. pname):match("TYPE=\"(.*)\"")
if blkid then
return "(" .. blkid .. ")"
end
end
function get_status(raid)
for m,member in ipairs(raid.members) do
for d,dev in ipairs(devinfo) do
if member.name == dev.name then
return dev.status
end
for p,part in ipairs(dev.parts) do
if member.name == part.name then
return dev.status
end
end
end
end
end
function get_parts(dev,status,size)
local c = 1
local unused = size
local parts = {}
for part in nixio.fs.glob("/sys/block/" .. dev .."/" .. dev .. "*") do
local pname = nixio.fs.basename(part)
local psize = nixio.fs.readfile(part .. "/size")
table.insert(parts, {name=pname, size=psize, perc=math.floor(psize*100/size), fs=get_fs(pname,status), color=colors[c]})
c = c + 1
unused = unused - psize
end
if unused > 2048 then
table.insert(parts, { name="", fs=get_fs(dev,status), size=unused, color=colors[c] })
end
return parts
end
for dev in nixio.fs.glob("/sys/block/*") do
if nixio.fs.access(dev .. "/md") then
local name = nixio.fs.basename(dev)
local rlevel = first_line(nixio.fs.readfile(dev .. "/md/level"))
local ndisks = tonumber(nixio.fs.readfile(dev .. "/md/raid_disks"))
local size = tonumber(nixio.fs.readfile(dev .. "/size"))
local metav = nixio.fs.readfile(dev .. "/md/metadata_version")
local degr = tonumber(nixio.fs.readfile(dev .. "/md/degraded"))
local sync = first_line(nixio.fs.readfile(dev .. "/md/sync_action"))
local sync_speed = tonumber(nixio.fs.readfile(dev .. "/md/sync_speed"))
local sync_compl = nixio.fs.readfile(dev .. "/md/sync_completed")
local status = "active"
if sync ~= "idle" then
local progress, total = nixio.fs.readfile(dev .. "/md/sync_completed"):match("^([0-9]*)[^0-9]*([0-9]*)")
local rem = (total - progress) / sync_speed / 2
local rems = math.floor(rem % 60)
if rems < 10 then rems = "0" .. rems end
rem = math.floor(rem / 60)
local remm = math.floor(rem % 60)
if remm < 10 then remm = "0" .. remm end
local remh = math.floor(rem / 60)
local remstr = remh .. ":" .. remm .. ":" .. rems
status = sync .. " (" .. math.floor(sync_speed/1024) .. "MB/s, " .. math.floor(progress * 1000 / total) /10 .. "%, rem. " .. remstr .. ")"
elseif degr == 1 then
status = "degraded"
end
local members = {}
local c = 1
for member in nixio.fs.glob("/sys/block/" .. name .. "/md/dev-*") do
local dname = nixio.fs.basename(nixio.fs.readlink(member .. "/block"))
local dsize = disp_size(tonumber(nixio.fs.readfile(member .. "/block/size")))
local dstate = nixio.fs.readfile(member .. "/state"):gsub("_", " "):match "^%s*(.-)%s*$"
table.insert(members, { name = dname, size = dsize, state = dstate, color = colors[c] })
c = c + 1
end
table.insert(raid, {name=name, rlevel=rlevel, ndisks=ndisks, size=size, metav=metav, status=status, members=members })
end
end
if show_disc == 1 then
for dev in nixio.fs.glob("/sys/class/nvme/*/device/nvme/*") do
local section
local model = nixio.fs.readfile(dev .. "/model")
local fw = nixio.fs.readfile(dev .. "/firmware_rev")
for bdev in nixio.fs.glob(dev .. "/nvme*") do
local section
local name = nixio.fs.basename(bdev)
local size = tonumber(nixio.fs.readfile(bdev .. "/size"))
local unused = size
local status = "-"
local temp = "-"
local serial = "-"
local secsize = "-"
for _,line in ipairs(luci.util.execl("smartctl -A -i -d nvme -n standby -f brief /dev/" .. name)) do
local attrib, val
if section == 1 then
attrib, val = line:match "^(.*):%s*(.*)"
elseif section == 2 then
attrib, val = line:match("^([0-9 ]*) [^ ]* * [POSRCK-]* *[0-9-]* *[0-9-]* *[0-9-]* *[0-9-]* *([0-9-]*)")
else
attrib = line:match "^=== START OF (.*) SECTION ==="
if attrib == "INFORMATION" then
section = 1
elseif attrib == "READ SMART DATA" then
section = 2
elseif status == "-" then
val = line:match "^Device is in (.*) mode"
if val then
status = val:lower()
end
end
end
if not attrib then
if section ~= 2 then section = 0 end
elseif (attrib == "Power mode is") or (attrib == "Power mode was") then
status = val:lower():match "(%S*)"
elseif attrib == "Serial Number" then
serial = val
elseif attrib == "194" then
temp = val .. "&deg;C"
end
end
table.insert(devinfo, {name=name, model=model, fw=fw, size=size, serial=serial, parts=get_parts(name,status,size) })
end
end
end
if show_raid == 1 and #devinfo > 0 then %>
<div class="cbi-section">
<h3><%:NVMe SSD%></h3>
<table class="cbi-section-table" style="white-space: nowrap">
<tr>
<th width="5%">&nbsp;</th>
<th width="30%"><%:Model%></th>
<th width="25%"><%:Serial number%></th>
<th width="20%"><%:Firmware%></th>
<th width="20%"><%:Capacity%></th>
<!-- <th width="10%"><%:Temperature%></th>-->
</tr>
<% local style=true
for d,dev in ipairs(devinfo) do %>
<tr class="cbi-section-table-row cbi-rowstyle-<%=(style and 1 or 2)%>">
<td class="cbi-vluae-field" style="padding-bottom:0px; border-bottom-width:0px; vertical-align:middle" rowspan="4"><%=dev.name%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=dev.model%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=dev.serial%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=dev.fw%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=disp_size(dev.size)%></td>
<!-- <td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=dev.temp%></td>-->
</tr>
<tr style="height:0px" />
<tr class="cbi-section-table-row cbi-rowstyle-<%=(style and 1 or 2)%>">
<td style="padding:0px; border-top-width:0px" colspan="7" rowspan="2">
<table style="border: 0pt; border-collapse:collapse; width:100%; padding:0px; margin:0px"><tr>
<% for _,part in pairs(dev.parts) do %>
<td style="text-align:center; padding: 0px 4px; border-radius: 3px; background-color:#<%=part.color%>" width="<%=part.perc%>%"><%=part.name%> <%=disp_size(part.size)%> <%=part.fs%></td>
<% end %>
</tr></table>
</td>
</tr>
<tr style="height:0px" />
<% style = not style
end %>
</table>
</div>
<% end %>