diff --git a/UnblockNeteaseMusic/Makefile b/UnblockNeteaseMusic/Makefile
index 5c9166b66..c7dd25917 100644
--- a/UnblockNeteaseMusic/Makefile
+++ b/UnblockNeteaseMusic/Makefile
@@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=UnblockNeteaseMusic
PKG_BASE_VERSION:=0.27.0-rc.4
-PKG_RELEASE:=53
+PKG_RELEASE:=54
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/UnblockNeteaseMusic/server.git
PKG_SOURCE_DATE:=2021-12-21
-PKG_SOURCE_VERSION:=6ed9f70c78a083f91c38e2a507d2977ea429d742
+PKG_SOURCE_VERSION:=513c1c6313f3c287a9363ecbb0c1530af62b2e4d
PKG_MIRROR_HASH:=skip
PKG_VERSION:=$(PKG_BASE_VERSION)-$(PKG_SOURCE_DATE)-$(call version_abbrev,$(PKG_SOURCE_VERSION))
diff --git a/luci-app-easyupdate/luasrc/controller/easyupdate.lua b/luci-app-easyupdate/luasrc/controller/easyupdate.lua
index 57d80a670..c2839e4da 100644
--- a/luci-app-easyupdate/luasrc/controller/easyupdate.lua
+++ b/luci-app-easyupdate/luasrc/controller/easyupdate.lua
@@ -57,10 +57,8 @@ end
function getver()
local e={}
- local c=luci.model.uci.cursor()
- local l=Split(c:get("easyupdate", "main", "github"), "/")
- e.newver=luci.sys.exec("uclient-fetch -qO- 'https://api.github.com/repos/" .. l[4] .. "/" .. l[5] .. "/releases/latest' | jsonfilter -e '@.tag_name'")
- e.newver=e.newver:sub(e.newver:find('_')+1,-2)
+ e.newver=luci.sys.exec("/usr/bin/easyupdate.sh -c")
+ e.newver=e.newver:sub(0,-2)
e.newverint=os.time({day=e.newver:sub(7,8), month=e.newver:sub(5,6), year=e.newver:sub(1,4), hour=e.newver:sub(10,11), min=e.newver:sub(12,13), sec=e.newver:sub(14,15)})
luci.http.prepare_content("application/json")
luci.http.write_json(e)
@@ -68,26 +66,8 @@ end
function download()
local e={}
- local c=luci.model.uci.cursor()
- local l=Split(c:get("easyupdate", "main", "github"), "/")
- local sedd
- if nixio.fs.access("/sys/firmware/efi") then
- sedd="combined-efi.img.gz"
- else
- sedd="combined.img.gz"
- end
- local url=luci.sys.exec("uclient-fetch -qO- 'https://api.github.com/repos/" .. l[4] .. "/" .. l[5] .. "/releases/latest' | jsonfilter -e '@.assets[*].browser_download_url' | sed -n '/" .. sedd .. "/p'")
- url=url:gsub("\n","")
- local u=c:get("easyupdate", "main", "proxy")
- if u then
- u="https://ghproxy.com/"
- else
- u=""
- end
- local l=Split(url, "/")
- luci.sys.exec("uclient-fetch -O '/tmp/" .. l[9] .. "' '" .. u .. url .. "' > /tmp/easyupdate.log 2>&1 &")
+ luci.sys.exec("/usr/bin/easyupdate.sh -d")
e.code=1
- e.data=l[9]
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end
@@ -102,14 +82,7 @@ end
function flash()
local e={}
local f = luci.http.formvalue('file')
- local c=luci.model.uci.cursor()
- local k=c:get("easyupdate", "main", "keepconfig")
- if k then
- k=""
- else
- k="-n"
- end
- luci.sys.exec("sysupgrade " .. k .. " '/tmp/" .. f .. "' > /tmp/easyupdate.log 2>&1 &")
+ luci.sys.exec("/usr/bin/easyupdate.sh -f " .. f)
e.code=1
luci.http.prepare_content("application/json")
luci.http.write_json(e)
diff --git a/luci-app-easyupdate/luasrc/model/cbi/easyupdate.lua b/luci-app-easyupdate/luasrc/model/cbi/easyupdate.lua
index 53986804b..7603f12b5 100644
--- a/luci-app-easyupdate/luasrc/model/cbi/easyupdate.lua
+++ b/luci-app-easyupdate/luasrc/model/cbi/easyupdate.lua
@@ -1,7 +1,8 @@
local pcall, dofile, _G = pcall, dofile, _G
pcall(dofile, "/etc/openwrt_release")
+local fs = require "nixio.fs"
-m=Map("easyupdate",translate("EasyUpdate"),translate("EasyUpdate LUCI supports scheduled upgrade & one-click firmware upgrade") .. [[
Powered by sundaqiang]])
+m=Map("easyupdate",translate("EasyUpdate"),translate("EasyUpdate LUCI supports scheduled upgrade & one-click firmware upgrade.") .. [[
]] .. translate("Update may cause the restart failure, Exercise caution when selecting automatic update.") .. [[
Powered by sundaqiang]])
s=m:section(TypedSection,"easyupdate")
s.anonymous=true
@@ -23,35 +24,67 @@ f.default=0
f.optional=false
w=s:option(ListValue,"week",translate("Update Time"),translate("Advised to set the automatic update time to idle time."))
-w:value(7,translate("Everyday"))
+w:value(0,translate("Everyday"))
w:value(1,translate("Monday"))
w:value(2,translate("Tuesday"))
w:value(3,translate("Wednesday"))
w:value(4,translate("Thursday"))
w:value(5,translate("Friday"))
w:value(6,translate("Saturday"))
-w:value(0,translate("Sunday"))
-w.default=0
+w:value(7,translate("Sunday"))
+w.default=1
w:depends("enable", "1")
-h=s:option(Value,"hour",translate("Hour"))
+h=s:option(Value,"hour",translate("Hour"),translate("Only 0 to 23 can be entered."))
h.datatype="range(0,23)"
h.rmempty=true
h.default=0
h:depends("enable", "1")
-n=s:option(Value,"minute",translate("Minute"))
+n=s:option(Value,"minute",translate("Minute"),translate("Only 0 to 59 can be entered."))
n.datatype="range(0,59)"
n.rmempty=true
n.default=30
n:depends("enable", "1")
-g=s:option(Value,"github",translate("Github Url"),translate("Your Github project address "))
+g=s:option(Value,"github",translate("Github Url"),translate("Your Github project address."))
g.default=''
g.rmempty=false
+l=s:option(TextValue,"",translate("Log"))
+l.rmempty = true
+l.rows = 15
+function l.cfgvalue()
+ return fs.readfile("/tmp/easyupdatemain.log") or ""
+end
+l.readonly="readonly"
+
b=s:option(Button,"",translate("Firmware Upgrade"))
b.template="easyupdate/button"
b.versions=_G.DISTRIB_VERSIONS
+local apply = luci.http.formvalue("cbi.apply")
+if apply then
+ local enable = luci.http.formvalue("cbid.easyupdate.main.enable")
+ crontabs=fs.readfile("/etc/crontabs/root")
+ if enable then
+ crontabs=crontabs:gsub('[%d%* ]+/usr/bin/easyupdate%.sh %-u # EasyUpdate\n', '')
+ if crontabs:sub(-1) == '\n' then
+ n=''
+ else
+ n='\n'
+ end
+ local week = luci.http.formvalue("cbid.easyupdate.main.week")
+ if week == '0' then
+ week='*'
+ end
+ local hour = luci.http.formvalue("cbid.easyupdate.main.hour")
+ local minute = luci.http.formvalue("cbid.easyupdate.main.minute")
+ crontabs=crontabs .. n .. minute .. ' ' .. hour .. ' ' .. '* * ' .. week .. ' /usr/bin/easyupdate.sh -u # EasyUpdate\n'
+ else
+ crontabs=crontabs:gsub('[%d%* ]+/usr/bin/easyupdate%.sh %-u # EasyUpdate\n', '')
+ end
+ fs.writefile ("/etc/crontabs/root", crontabs)
+end
+
return m
\ No newline at end of file
diff --git a/luci-app-easyupdate/luasrc/view/easyupdate/button.htm b/luci-app-easyupdate/luasrc/view/easyupdate/button.htm
index ccb9f2848..1975fa2ba 100644
--- a/luci-app-easyupdate/luasrc/view/easyupdate/button.htm
+++ b/luci-app-easyupdate/luasrc/view/easyupdate/button.htm
@@ -58,6 +58,10 @@
body.apply-overlay-active #update_apply_overlay {
display: block;
}
+
+ .cbi-input-textarea {
+ width: 45VW!important;
+ }