Merge Lean's source

This commit is contained in:
CN_SZTL 2020-02-18 13:07:48 +08:00
parent 582df8515f
commit 4b3d226812
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
6 changed files with 15 additions and 16 deletions

View File

@ -1,24 +1,21 @@
#
# Copyright (C) 2015-2016 OpenWrt.org
# Copyright (C) 2015-2020 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v3.
#
# licheng
# www.maxlicheng.com
# 2019-07-28
#
include $(TOPDIR)/rules.mk
PKG_NAME:=UnblockNeteaseMusic
PKG_VERSION:=0.23.1
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_LICENSE:=MIT
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/nondanee/UnblockNeteaseMusic.git
PKG_SOURCE_VERSION:=1251b9d96826ce5bb63131d0f18696253ec02127
PKG_SOURCE_VERSION:=586d043806ed8885319d9fcb4806cd05dfa71f09
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR)-$(PKG_VERSION).tar.gz

View File

@ -4,7 +4,7 @@
local m, sec, o
local shadowsocksr = "shadowsocksr"
local uci = luci.model.uci.cursor()
local ipkg = require("luci.model.ipkg")
m = Map(shadowsocksr, translate("ShadowSocksR Server"))

View File

@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-unblockmusic
PKG_VERSION:=2.3.1
PKG_RELEASE:=11
PKG_RELEASE:=12
PKG_LICENSE:=Apache-2.0

View File

@ -62,7 +62,7 @@ o.inputtitle = translate("更新核心版本")
o.description = string.format(translate("目前运行主程序版本") .. "<strong><font color=\"green\">: %s </font></strong>", ver)
o.inputstyle = "reload"
o.write = function()
luci.sys.exec("/usr/share/UnblockNeteaseMusic/update_core.sh 2>&1")
luci.sys.exec("/usr/share/UnblockNeteaseMusic/update_core.sh luci_update 2>&1")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "unblockmusic"))
end

View File

@ -6,10 +6,8 @@ log_file="/tmp/unblockmusic.log"
while true
do
sleep 10s
icount=`busybox ps -w | grep UnblockNeteaseMusic/app.js |grep -v grep| wc -l`
if [ $icount -ne 1 ] ;then
/etc/init.d/unblockmusic restart
fi
icount=`busybox ps -w | grep UnblockNeteaseMusic/app.js |grep -v grep`
[ -z "$icount" ] && /etc/init.d/unblockmusic restart
(( log_size = "$(ls -l "${log_file}" | awk -F ' ' '{print $5}')" / "1024" ))
(( "${log_size}" >= "${log_max_size}" )) && echo "" > /tmp/unblockmusic.log
sleep 10m

View File

@ -24,6 +24,7 @@ function check_latest_version(){
else
echo -e "\nLocal version: $(cat /usr/share/UnblockNeteaseMusic/local_ver 2>/dev/null), cloud version: ${latest_ver}." >>/tmp/unblockmusic_update.log
echo -e "You're already using the latest version." >>/tmp/unblockmusic_update.log
[ "${luci_update}" == "n" ] && /etc/init.d/unblockmusic restart
exit 3
fi
fi
@ -47,14 +48,14 @@ function update_core(){
echo -e "Failed to download core." >>/tmp/unblockmusic_update.log
exit 1
else
[ "${luci_update}" == "y" ] && touch "/usr/share/unblockneteasemusic/update_successfully"
echo -e "${latest_ver}" > /usr/share/UnblockNeteaseMusic/local_ver
/etc/init.d/unblockmusic restart
cat /usr/share/UnblockNeteaseMusic/package-lock.json | grep version |awk -F ':' '{print $2}' | cut -c3-8 > /usr/share/UnblockNeteaseMusic/core_ver
fi
echo -e "Succeeded in updating core." >/tmp/unblockmusic_update.log
echo -e "Local version: $(cat /usr/share/UnblockNeteaseMusic/local_ver 2>/dev/null), cloud version: ${latest_ver}.\n" >>/tmp/unblockmusic_update.log
cat /usr/share/UnblockNeteaseMusic/package-lock.json | grep version |awk -F ':' '{print $2}' | cut -c3-8 > /usr/share/UnblockNeteaseMusic/core_ver
/etc/init.d/unblockmusic restart
}
function main(){
@ -62,4 +63,7 @@ function main(){
check_latest_version
}
luci_update="n"
[ "$1" == "luci_update" ] && luci_update="y"
main