mirror of
https://github.com/kenzok8/small-package
synced 2025-01-05 11:36:47 +08:00
update 2024-05-30 14:13:01
This commit is contained in:
parent
f46da6333a
commit
619fb4c9e3
@ -83,4 +83,4 @@ msgid "Toggle"
|
||||
msgstr "开/关"
|
||||
|
||||
msgid "Dashboard is a frontend management panel, meant for configuration use only."
|
||||
msgstr "仪表板是一个前端管理面板,仅应在配置过程中启用。"
|
||||
msgstr "仪表板是一个前端管理面板,仅应在配置过程中启用。(登录后若浏览器未自动跳转,请手动刷新页面)"
|
||||
|
@ -6,9 +6,9 @@ function index()
|
||||
end
|
||||
local c=luci.model.uci.cursor()
|
||||
local r=0
|
||||
if not c:get("easyupdate", "main", "proxy") then
|
||||
if not c:get("easyupdate", "main", "mirror") then
|
||||
r=1
|
||||
c:set("easyupdate", "main", "proxy", "1")
|
||||
c:set("easyupdate", "main", "mirror", "")
|
||||
end
|
||||
if not c:get("easyupdate", "main", "keepconfig") then
|
||||
r=1
|
||||
|
@ -11,9 +11,9 @@ e=s:option(Flag, "enable", translate("Enable"),translate("When selected, firmwar
|
||||
e.default=0
|
||||
e.optional=false
|
||||
|
||||
p=s:option(Flag, "proxy", translate("Use China Mirror"),translate("When selected, will use the China mirror when accessing Github."))
|
||||
p.default=1
|
||||
p.optional=false
|
||||
p=s:option(Value,"mirror",translate("Mirror Url"),translate("Once configured, the mirror URL will be used when accessing Github."))
|
||||
p.default=''
|
||||
p.rmempty=false
|
||||
|
||||
k= s:option(Flag, "keepconfig", translate("KEEP CONFIG"),translate("When selected, configuration is retained when firmware upgrade."))
|
||||
k.default=1
|
||||
|
@ -10,8 +10,11 @@ msgstr "升级可能导致重启失败,请谨慎选择自动升级"
|
||||
msgid "When selected, firmware upgrade will be automatically at the specified time."
|
||||
msgstr "选中后,系统将在指定的时间自动升级固件。"
|
||||
|
||||
msgid "When selected, will use the China mirror when accessing Github."
|
||||
msgstr "选中后,将在访问Github时使用中国镜像。"
|
||||
msgid "Mirror Url"
|
||||
msgstr "镜像网址"
|
||||
|
||||
msgid "Once configured, the mirror URL will be used when accessing Github."
|
||||
msgstr "配置后,在访问Github时将使用镜像网址。"
|
||||
|
||||
msgid "KEEP CONFIG"
|
||||
msgstr "保留配置"
|
||||
|
@ -50,19 +50,11 @@ function downCloudVer() {
|
||||
writeLog 'Get the cloud firmware link(获取云端固件链接)'
|
||||
url=$(curl "https://api.github.com/repos/${github[2]}/${github[3]}/releases/latest" | jsonfilter -e '@.assets[*].browser_download_url' | sed -n "/$suffix/p")
|
||||
writeLog "Cloud firmware link(云端固件链接):$url"
|
||||
writeLog 'Get whether to use Chinese mirror(读取是否使用中国镜像)'
|
||||
proxy=$(uci get easyupdate.main.proxy)
|
||||
if [ $proxy -eq 1 ]; then
|
||||
proxy='https://ghproxy.com/'
|
||||
res='yes'
|
||||
else
|
||||
proxy=''
|
||||
res='no'
|
||||
fi
|
||||
writeLog "Whether to use Chinese mirror(是否使用中国镜像):$res"
|
||||
mirror=$(uci get easyupdate.main.mirror)
|
||||
writeLog "Use mirror URL(使用镜像网站):$mirror"
|
||||
fileName=(${url//// })
|
||||
curl -o "/tmp/${fileName[7]}-sha256" "$proxy${url/${fileName[7]}/sha256sums}"
|
||||
curl -o "/tmp/${fileName[7]}" "$proxy$url" >/tmp/easyupdate.log 2>&1 &
|
||||
curl -o "/tmp/${fileName[7]}-sha256" -L "$mirror${url/${fileName[7]}/sha256sums}"
|
||||
curl -o "/tmp/${fileName[7]}" -L "$mirror$url" >/tmp/easyupdate.log 2>&1 &
|
||||
writeLog 'Start downloading firmware, log output in /tmp/easyupdate.log(开始下载固件,日志输出在/tmp/easyupdate.log)'
|
||||
}
|
||||
|
||||
|
@ -77,11 +77,6 @@ function update()
|
||||
filename = "supervisord_" .. version:gsub("v", "") .. "_Linux_" .. arch .. ".tar.gz"
|
||||
nixio.fs.remove("/tmp/" .. filename)
|
||||
u=c:get("supervisord", "main", "usechinamirror")
|
||||
if u then
|
||||
u="https://ghproxy.com/"
|
||||
else
|
||||
u=""
|
||||
end
|
||||
e.error=luci.sys.call("uclient-fetch -qO- -O '/tmp/" .. filename .. "' '" .. u .. "https://github.com/ochinchina/supervisord/releases/download/" .. version .. "/" .. filename .. "'")
|
||||
if e.error == 0 then
|
||||
e.error=luci.sys.exec("tar -xzvf '/tmp/" .. filename .. "' -C /tmp")
|
||||
|
Loading…
Reference in New Issue
Block a user