mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00
Revert "luci-app-ssr-plus: fix ssrp alwawys start two server (#3875)"
This reverts commit 033b0ec159
.
This commit is contained in:
parent
94b0ae0126
commit
c26e558be6
@ -223,7 +223,7 @@ start_rules() {
|
||||
else
|
||||
proxyport="-m multiport --dports 22,53,587,465,995,993,143,80,443"
|
||||
fi
|
||||
if [ "$NETFLIX_SERVER" != "$GLOBAL_SERVER" ]; then
|
||||
if [ "$NETFLIX_SERVER" != "same" ]; then
|
||||
netflix="1"
|
||||
else
|
||||
netflix="0"
|
||||
@ -398,7 +398,7 @@ start_redir() {
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") Network Tunnel REDIRECT $threads Threads Started!" >>/tmp/ssrplus.log
|
||||
fi
|
||||
|
||||
if [ "$NETFLIX_SERVER" != "$GLOBAL_SERVER" ]; then
|
||||
if [ "$NETFLIX_SERVER" != "same" ]; then
|
||||
if [ "$ntype" == "ss" -o "$ntype" == "ssr" ]; then
|
||||
gen_config_file $NETFLIX_SERVER 2 4321
|
||||
gen_config_file $NETFLIX_SERVER 3 1088
|
||||
@ -592,7 +592,7 @@ rules() {
|
||||
[ "$GLOBAL_SERVER" == "nil" ] && return 1
|
||||
mkdir -p /var/run /var/etc
|
||||
UDP_RELAY_SERVER=$(uci_get_by_type global udp_relay_server)
|
||||
[ "$UDP_RELAY_SERVER" == "$GLOBAL_SERVER" ] && UDP_RELAY_SERVER=$GLOBAL_SERVER
|
||||
[ "$UDP_RELAY_SERVER" == "same" ] && UDP_RELAY_SERVER=$GLOBAL_SERVER
|
||||
if start_rules; then
|
||||
return 0
|
||||
else
|
||||
@ -629,27 +629,25 @@ start() {
|
||||
rm -f /tmp/dnsmasq.ssr/ad.conf
|
||||
fi
|
||||
/usr/share/shadowsocksr/gfw2ipset.sh
|
||||
|
||||
if [ "$NETFLIX_SERVER" != "same" ]; then
|
||||
cat /etc/config/netflix.list | while read line || [ -n "$line" ];
|
||||
do
|
||||
sed -i "/$line/d" /tmp/dnsmasq.ssr/gfw_list.conf
|
||||
done
|
||||
awk '!/^$/&&!/^#/{printf("ipset=/.%s/'"netflix"'\n",$0)}' /etc/config/netflix.list > /tmp/dnsmasq.ssr/netflix_forward.conf
|
||||
awk '!/^$/&&!/^#/{printf("server=/.%s/'"127.0.0.1#5555"'\n",$0)}' /etc/config/netflix.list >> /tmp/dnsmasq.ssr/netflix_forward.conf
|
||||
|
||||
ipset -N netflix hash:net 2>/dev/null
|
||||
cat /etc/config/netflixip.list | while read nip || [ -n "$nip" ];
|
||||
do
|
||||
ipset add netflix $nip 2>/dev/null
|
||||
done
|
||||
|
||||
if [ "$NETFLIX_SERVER" != "$GLOBAL_SERVER" ]; then
|
||||
cat /etc/config/netflix.list | while read line || [ -n "$line" ];
|
||||
do
|
||||
sed -i "/$line/d" /tmp/dnsmasq.ssr/gfw_list.conf
|
||||
done
|
||||
awk '!/^$/&&!/^#/{printf("ipset=/.%s/'"netflix"'\n",$0)}' /etc/config/netflix.list > /tmp/dnsmasq.ssr/netflix_forward.conf
|
||||
awk '!/^$/&&!/^#/{printf("server=/.%s/'"127.0.0.1#5555"'\n",$0)}' /etc/config/netflix.list >> /tmp/dnsmasq.ssr/netflix_forward.conf
|
||||
|
||||
ipset add ss_spec_wan_ac $(check_host $(uci_get_by_name $NETFLIX_SERVER server)) 2>/dev/null
|
||||
else
|
||||
awk '!/^$/&&!/^#/{printf("ipset=/.%s/'"netflix"'\n",$0)}' /etc/config/netflix.list > /tmp/dnsmasq.ssr/netflix_forward.conf
|
||||
awk '!/^$/&&!/^#/{printf("server=/.%s/'"127.0.0.1#5335"'\n",$0)}' /etc/config/netflix.list >> /tmp/dnsmasq.ssr/netflix_forward.conf
|
||||
|
||||
fi
|
||||
|
||||
ipset -N netflix hash:net 2>/dev/null
|
||||
cat /etc/config/netflixip.list | while read nip || [ -n "$nip" ];
|
||||
do
|
||||
ipset add netflix $nip 2>/dev/null
|
||||
done
|
||||
ipset add ss_spec_wan_ac $(check_host $(uci_get_by_name $NETFLIX_SERVER server)) 2>/dev/null
|
||||
else
|
||||
rm -f /tmp/dnsmasq.ssr/netflix_forward.conf
|
||||
fi
|
||||
|
||||
/etc/init.d/dnsmasq restart >/dev/null 2>&1
|
||||
fi
|
||||
@ -725,4 +723,3 @@ stop() {
|
||||
fi
|
||||
del_cron
|
||||
}
|
||||
|
||||
|
@ -121,9 +121,7 @@ ipset_r() {
|
||||
for ip in $WAN_FW_IP; do ipset -! add blacklist $ip; done
|
||||
|
||||
if [ "$NETFLIX" == "1" ]; then
|
||||
$IPT -I SS_SPEC_WAN_AC -p tcp -m set --match-set netflix dst -j REDIRECT --to-ports 4321
|
||||
else
|
||||
$IPT -I SS_SPEC_WAN_AC -p tcp -m set --match-set netflix dst -j REDIRECT --to-ports $local_port
|
||||
$IPT -I SS_SPEC_WAN_AC -p tcp -m set --match-set netflix dst -j REDIRECT --to-ports 4321
|
||||
fi
|
||||
return $?
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user