diff --git a/package/ctcgfw/luci-app-unblockneteasemusic/Makefile b/package/ctcgfw/luci-app-unblockneteasemusic/Makefile index b7ecbd2021..99387d886c 100644 --- a/package/ctcgfw/luci-app-unblockneteasemusic/Makefile +++ b/package/ctcgfw/luci-app-unblockneteasemusic/Makefile @@ -12,7 +12,7 @@ LUCI_DEPENDS:=+bash +busybox +coreutils-nohup +curl +dnsmasq-full +ipset +libope LUCI_PKGARCH:=all PKG_NAME:=luci-app-unblockneteasemusic PKG_VERSION:=2.7 -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_MAINTAINER:=[CTCGFW]Project-OpenWrt diff --git a/package/ctcgfw/luci-app-unblockneteasemusic/root/etc/init.d/unblockneteasemusic b/package/ctcgfw/luci-app-unblockneteasemusic/root/etc/init.d/unblockneteasemusic index cbab70c2e7..ad49c034fe 100755 --- a/package/ctcgfw/luci-app-unblockneteasemusic/root/etc/init.d/unblockneteasemusic +++ b/package/ctcgfw/luci-app-unblockneteasemusic/root/etc/init.d/unblockneteasemusic @@ -64,11 +64,15 @@ ipset=/clientlog3.music.163.com/neteasemusic iptables -t nat -A "netease_cloud_music" -p tcp --dport 80 -j REDIRECT --to-ports "${http_port}" iptables -t nat -A "netease_cloud_music" -p tcp --dport 443 -j REDIRECT --to-ports "${https_port}" iptables -t nat -I PREROUTING -p tcp -m set --match-set "neteasemusic" dst -j "netease_cloud_music" + [ -z "$(iptables -t nat -L "ADBYBY" | grep "UnblockMusic" | sed 's/\/.*//')" ] && iptables -t nat -I "ADBYBY" -m set --match-set "neteasemusic" dst -j RETURN -m comment --comment "AD for UnblockMusic" + [ -z "$(iptables -t nat -L "KOOLPROXY" | grep "UnblockMusic" | sed 's/\/.*//')" ] && iptables -t nat -I "KOOLPROXY" -m set --match-set "neteasemusic" dst -j RETURN -m comment --comment "KP for UnblockMusic" mkdir -p "/var/etc/" echo -e "/etc/init.d/unblockneteasemusic restart" > "/var/etc/unblockneteasemusic.include" elif [ "${set_type}" = "stop" ]; then - iptables -t nat -D PREROUTING -p tcp -m set --match-set "neteasemusic" dst -j "netease_cloud_music" + iptables -t nat -D "PREROUTING" -p tcp -m set --match-set "neteasemusic" dst -j "netease_cloud_music" + iptables -t nat -D "ADBYBY" -m set --match-set "neteasemusic" dst -j RETURN -m comment --comment "AD for UnblockMusic" + iptables -t nat -D "KOOLPROXY" -m set --match-set "neteasemusic" dst -j RETURN -m comment --comment "KP for UnblockMusic" iptables -t nat -F "netease_cloud_music" iptables -t nat -X "netease_cloud_music" ipset destroy "neteasemusic" diff --git a/package/ctcgfw/luci-app-unblockneteasemusic/root/etc/ppp/ip-up.d/unblockneteasemusic b/package/ctcgfw/luci-app-unblockneteasemusic/root/etc/ppp/ip-up.d/unblockneteasemusic index 58b1da2fae..f48a3ec715 100755 --- a/package/ctcgfw/luci-app-unblockneteasemusic/root/etc/ppp/ip-up.d/unblockneteasemusic +++ b/package/ctcgfw/luci-app-unblockneteasemusic/root/etc/ppp/ip-up.d/unblockneteasemusic @@ -1,4 +1,5 @@ #!/bin/sh sleep 10 +if ! ipset list "neteasemusic" > "/dev/null"; then ipset create "neteasemusic" hash:ip; fi curl -s "http://httpdns.n.netease.com/httpdns/v2/d?domain=music.163.com,interface.music.163.com,interface3.music.163.com,apm.music.163.com,apm3.music.163.com,clientlog.music.163.com,clientlog3.music.163.com" |grep -Eo '[0-9]+?\.[0-9]+?\.[0-9]+?\.[0-9]+?' |sort |uniq |awk '{print "ipset add neteasemusic "$1}' |bash > "/dev/null" 2>&1