mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-19 14:13:30 +00:00
Merge branch 'master' of https://github.com/coolsnowwolf/lede
This commit is contained in:
commit
7aa37fbf30
@ -11,14 +11,14 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=UnblockNeteaseMusic
|
||||
PKG_VERSION:=0.20.3
|
||||
PKG_VERSION:=0.20.4
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/nondanee/UnblockNeteaseMusic.git
|
||||
PKG_SOURCE_VERSION:=9675b15cbcda37a5b19695c8cfa9f9c63b094b88
|
||||
PKG_SOURCE_VERSION:=023a97f0e62d322a8d64c59ef3942da7c8a1b546
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
|
||||
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR)-$(PKG_VERSION).tar.gz
|
||||
@ -43,8 +43,9 @@ endef
|
||||
|
||||
define Build/Prepare
|
||||
tar -xzvf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR)
|
||||
echo -e $(PKG_VERSION) > $(PKG_BUILD_DIR)/UnblockNeteaseMusic/core_ver
|
||||
echo -e $(PKG_SOURCE_VERSION) > $(PKG_BUILD_DIR)/UnblockNeteaseMusic/local_ver
|
||||
mkdir -p $(PKG_BUILD_DIR)/$(PKG_NAME)
|
||||
echo -e $(PKG_VERSION) > $(PKG_BUILD_DIR)/$(PKG_NAME)/core_ver
|
||||
echo -e $(PKG_SOURCE_VERSION) > $(PKG_BUILD_DIR)/$(PKG_NAME)/local_ver
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
|
@ -11,12 +11,12 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-unblockmusic
|
||||
PKG_VERSION:=2.2.0
|
||||
PKG_RELEASE:=8
|
||||
PKG_RELEASE:=9
|
||||
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
|
||||
LUCI_TITLE:=LuCI support for Unblock NeteaseCloudMusic
|
||||
LUCI_DEPENDS:=+UnblockNeteaseMusic +bash +dnsmasq-full +ipset +bash
|
||||
LUCI_DEPENDS:=+UnblockNeteaseMusic +bash +dnsmasq-full +ipset
|
||||
LUCI_PKGARCH:=all
|
||||
|
||||
PKG_MAINTAINER:=lean
|
||||
|
@ -8,7 +8,7 @@ t = f:field(TextValue, "conf")
|
||||
t.rmempty = true
|
||||
t.rows = 20
|
||||
function t.cfgvalue()
|
||||
luci.sys.exec(" sed '/MITM/d' /tmp/unblockmusic.log > /tmp/music.log")
|
||||
luci.sys.exec("grep -B 1 'http' /tmp/unblockmusic.log > /tmp/music.log")
|
||||
return fs.readfile(conffile) or ""
|
||||
end
|
||||
t.readonly="readonly"
|
||||
|
@ -25,7 +25,7 @@ add_rule()
|
||||
$ipt_n -A cloud_music -d 192.168.0.0/16 -j RETURN
|
||||
$ipt_n -A cloud_music -d 224.0.0.0/4 -j RETURN
|
||||
$ipt_n -A cloud_music -d 240.0.0.0/4 -j RETURN
|
||||
$ipt_n -A cloud_music -p tcp -j REDIRECT --to-ports 5200
|
||||
$ipt_n -A cloud_music -p tcp -j REDIRECT --to-ports 5202
|
||||
$ipt_n -I PREROUTING -p tcp --dport 80 -m set --match-set music dst -j cloud_music
|
||||
}
|
||||
|
||||
@ -83,8 +83,10 @@ start()
|
||||
|
||||
if [ $TYPE = "default" ]; then
|
||||
node /usr/share/UnblockNeteaseMusic/app.js $endponintset -p 5200:5201 >/tmp/unblockmusic.log 2>&1 &
|
||||
node /usr/share/UnblockNeteaseMusic/app.js -p 5202 >>/tmp/unblockmusic.log 2>&1 &
|
||||
else
|
||||
node /usr/share/UnblockNeteaseMusic/app.js $endponintset -p 5200:5201 -o $TYPE >/tmp/unblockmusic.log 2>&1 &
|
||||
node /usr/share/UnblockNeteaseMusic/app.js -p 5202 -o $TYPE >>/tmp/unblockmusic.log 2>&1 &
|
||||
fi
|
||||
|
||||
set_firewall
|
||||
|
@ -1,10 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
log_max_size="4" #使用KB计算
|
||||
log_max_size="10" #使用KB计算
|
||||
log_file="/tmp/unblockmusic.log"
|
||||
|
||||
while true
|
||||
do
|
||||
sleep 10s
|
||||
icount=`busybox ps -w | grep app.js |grep -v grep| wc -l`
|
||||
if [ $icount -ne 2 ] ;then
|
||||
/etc/init.d/unblockmusic restart
|
||||
fi
|
||||
(( log_size = "$(ls -l "${log_file}" | awk -F ' ' '{print $5}')" / "1024" ))
|
||||
(( "${log_size}" >= "${log_max_size}" )) && echo "" > /tmp/unblockmusic.log
|
||||
sleep 10m
|
||||
|
Loading…
Reference in New Issue
Block a user