Skip to content

Commit

Permalink
refactor: Reset port to 5200 and 5201
Browse files Browse the repository at this point in the history
  • Loading branch information
binsee committed Jan 19, 2020
1 parent c4198fb commit e57ec20
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/root/etc/init.d/unblockmusic
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ 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 --dport 80 -j REDIRECT --to-ports 5201
$ipt_n -A cloud_music -p tcp --dport 443 -j REDIRECT --to-ports 5202
$ipt_n -A cloud_music -p tcp --dport 80 -j REDIRECT --to-ports 5200
$ipt_n -A cloud_music -p tcp --dport 443 -j REDIRECT --to-ports 5201
$ipt_n -I PREROUTING -p tcp -m set --match-set music dst -j cloud_music
wget 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 -O- | grep -Eo '[0-9]+?\.[0-9]+?\.[0-9]+?\.[0-9]+?' | sort | uniq | awk '{print "ipset -! add music "$1}' | sh

Expand All @@ -48,7 +48,7 @@ del_rule(){
set_firewall(){
rm -f /tmp/dnsmasq.d/dnsmasq-163.conf
mkdir -p /tmp/dnsmasq.d
echo "dhcp-option=252,http://$ROUTE_IP:5201/proxy.pac" > /tmp/dnsmasq.d/dnsmasq-163.conf
echo "dhcp-option=252,http://$ROUTE_IP:5200/proxy.pac" > /tmp/dnsmasq.d/dnsmasq-163.conf
echo "ipset=/music.163.com/music" >> /tmp/dnsmasq.d/dnsmasq-163.conf
echo "ipset=/interface.music.163.com/music" >> /tmp/dnsmasq.d/dnsmasq-163.conf
echo "ipset=/interface3.music.163.com/music" >> /tmp/dnsmasq.d/dnsmasq-163.conf
Expand Down Expand Up @@ -95,9 +95,9 @@ start()
echo "$(date -R) # Start UnblockNeteaseMusic" >/tmp/unblockmusic.log

if [ $TYPE = "default" ]; then
node /usr/share/UnblockNeteaseMusic/app.js $endponintset -p 5201:5202 >>/tmp/unblockmusic.log 2>&1 &
node /usr/share/UnblockNeteaseMusic/app.js $endponintset -p 5200:5201 >>/tmp/unblockmusic.log 2>&1 &
else
node /usr/share/UnblockNeteaseMusic/app.js $endponintset -p 5201:5202 -o $TYPE >>/tmp/unblockmusic.log 2>&1 &
node /usr/share/UnblockNeteaseMusic/app.js $endponintset -p 5200:5201 -o $TYPE >>/tmp/unblockmusic.log 2>&1 &
fi

set_firewall
Expand Down

0 comments on commit e57ec20

Please sign in to comment.