luci-app-unblockneteasemusic: bump to 2.4
This commit is contained in:
parent
bbbd9d231f
commit
d9eee117c0
@ -11,8 +11,8 @@ LUCI_TITLE:=LuCI support for UnblockNeteaseMusic
|
||||
LUCI_DEPENDS:=+bash +busybox +coreutils-nohup +curl +dnsmasq-full +ipset +libopenssl +node
|
||||
LUCI_PKGARCH:=all
|
||||
PKG_NAME:=luci-app-unblockneteasemusic
|
||||
PKG_VERSION:=2.3
|
||||
PKG_RELEASE:=3
|
||||
PKG_VERSION:=2.4
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_MAINTAINER:=[CTCGFW]Project-OpenWrt
|
||||
|
||||
|
||||
@ -54,10 +54,17 @@ hijack.default = "dont_hijack"
|
||||
hijack.rmempty = false
|
||||
|
||||
auto_update = s:option(Flag, "auto_update", translate("启用自动更新"))
|
||||
auto_update.description = translate("启用后会在每天凌晨检测最新版本并自动更新")
|
||||
auto_update.description = translate("启用后会在每天设定的时间自动检测最新版本并更新")
|
||||
auto_update.default = 0
|
||||
auto_update.rmempty = false
|
||||
|
||||
update_time = s:option(ListValue, "update_time", translate("自动更新时间"))
|
||||
for update_time_hour = 0,23 do
|
||||
update_time:value(update_time_hour, update_time_hour..":00")
|
||||
end
|
||||
update_time.default = "3"
|
||||
update_time.depends("auto_update", 1)
|
||||
|
||||
advanced_mode = s:option(Flag, "advanced_mode", translate("启用进阶设置"))
|
||||
advanced_mode.description = translate("仅推荐高级玩家使用")
|
||||
advanced_mode.default = 0
|
||||
|
||||
@ -5,7 +5,11 @@ config unblockneteasemusic
|
||||
option https_port '5201'
|
||||
option music_source 'default'
|
||||
option hijack_ways 'use_ipset'
|
||||
option auto_update '0'
|
||||
option auto_update '1'
|
||||
option update_time '3'
|
||||
option advanced_mode '0'
|
||||
option pub_access '0'
|
||||
option strict_mode '0'
|
||||
option netease_server_ip '59.111.181.38'
|
||||
option endpoint_url 'https://music.163.com'
|
||||
option proxy_server_ip ''
|
||||
|
||||
@ -14,6 +14,7 @@ music_source="$(uci get unblockneteasemusic.@unblockneteasemusic[0].music_source
|
||||
youtube_key="$(uci get unblockneteasemusic.@unblockneteasemusic[0].youtube_key 2>/dev/null)"
|
||||
hijack_ways="$(uci get unblockneteasemusic.@unblockneteasemusic[0].hijack_ways)"
|
||||
auto_update="$(uci get unblockneteasemusic.@unblockneteasemusic[0].auto_update)"
|
||||
update_time="$(uci get unblockneteasemusic.@unblockneteasemusic[0].update_time)"
|
||||
[ "*$(uci get unblockneteasemusic.@unblockneteasemusic[0].pub_access 2>/dev/null)*" = "*1*" ] && addr="0.0.0.0" || addr="${lan_addr}"
|
||||
[ "*$(uci get unblockneteasemusic.@unblockneteasemusic[0].strict_mode 2>/dev/null)*" = "*1*" ] && strict_mode="-s"
|
||||
netease_server_ip="$(uci get unblockneteasemusic.@unblockneteasemusic[0].netease_server_ip 2>/dev/null)"
|
||||
@ -110,21 +111,15 @@ set_ports(){
|
||||
if [ "${set_type}" = "start" ]; then
|
||||
iptables -I INPUT -p tcp --dport "${http_port}" -j ACCEPT
|
||||
iptables -I INPUT -p tcp --dport "${https_port}" -j ACCEPT
|
||||
ip6tables -I INPUT -p tcp --dport "${http_port}" -j ACCEPT
|
||||
ip6tables -I INPUT -p tcp --dport "${https_port}" -j ACCEPT
|
||||
|
||||
mkdir -p /var/etc
|
||||
cat <<-EOF >> "/var/etc/unblockneteasemusic.include"
|
||||
iptables -I INPUT -p tcp --dport "${http_port}" -j ACCEPT
|
||||
iptables -I INPUT -p tcp --dport "${https_port}" -j ACCEPT
|
||||
ip6tables -I INPUT -p tcp --dport "${http_port}" -j ACCEPT
|
||||
ip6tables -I INPUT -p tcp --dport "${https_port}" -j ACCEPT
|
||||
EOF
|
||||
elif [ "${set_type}" = "stop" ]; then
|
||||
iptables -D INPUT -p tcp --dport "${http_port}" -j ACCEPT
|
||||
iptables -D INPUT -p tcp --dport "${https_port}" -j ACCEPT
|
||||
ip6tables -D INPUT -p tcp --dport "${http_port}" -j ACCEPT
|
||||
ip6tables -D INPUT -p tcp --dport "${https_port}" -j ACCEPT
|
||||
|
||||
echo "" > "/var/etc/unblockneteasemusic.include"
|
||||
fi
|
||||
@ -160,7 +155,7 @@ start()
|
||||
[ "*$(uci get unblockneteasemusic.@unblockneteasemusic[0].pub_access 2>/dev/null)*" = "*1*" ] && set_ports >/dev/null 2>&1
|
||||
|
||||
sed -i '/unblockneteasemusic/d' /etc/crontabs/root
|
||||
[ "${auto_update}" -eq "1" ] && echo "30 3 * * * /usr/share/unblockneteasemusic/update_core.sh" >> "/etc/crontabs/root"
|
||||
[ "${auto_update}" -eq "1" ] && echo "0 ${update_time} * * * /usr/share/unblockneteasemusic/update_core.sh" >> "/etc/crontabs/root"
|
||||
echo "*/5 * * * * /usr/share/unblockneteasemusic/log_check.sh" >> "/etc/crontabs/root"
|
||||
/etc/init.d/cron restart >/dev/null 2>&1
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user