未验证 提交 e2b1d478 编写于 作者: M Mattraks 提交者: GitHub

luci-app-ssr-plus:Adjust uci-defaults (#4010)

上级 8d4027f1
......@@ -373,7 +373,7 @@ start_redir() {
else
threads=$(uci_get_by_type global threads)
fi
if [ "$stype" == "ss" -o "$stype" == "ssr" ]; then
local last_config_file=$CONFIG_FILE
local pid_file="/var/run/ssr-retcp.pid"
......@@ -606,7 +606,7 @@ start_local() {
rules() {
if [ "$GLOBAL_SERVER" == "nil" ]; then
return 1
else
else
redir_tcp=1
fi
mkdir -p /var/run /var/etc
......@@ -627,12 +627,12 @@ start() {
GLOBAL_SERVER=$switch_server
switch_enable=1
fi
NETFLIX_SERVER=$(uci_get_by_type global netflix_server nil)
if [ "$NETFLIX_SERVER" == "same" ]; then
NETFLIX_SERVER=$GLOBAL_SERVER
fi
if rules; then
start_redir
mkdir -p /tmp/dnsmasq.d && cp -a /etc/dnsmasq.ssr /tmp/ && cp -a /etc/dnsmasq.oversea /tmp/
......@@ -652,35 +652,31 @@ start() {
if [ "$NETFLIX_SERVER" != "nil" ]; then
if [ "$NETFLIX_SERVER" != "$GLOBAL_SERVER" ]; then
cat /etc/config/netflix.list | while read line || [ -n "$line" ];
do
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
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
cat /etc/config/netflixip.list | while read nip || [ -n "$nip" ]; do
ipset add netflix $nip 2>/dev/null
done
else
cat /etc/config/netflix.list | while read line || [ -n "$line" ];
do
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#5335"'\n",$0)}' /etc/config/netflix.list >> /tmp/dnsmasq.ssr/netflix_forward.conf
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
ipset -N netflix hash:net 2>/dev/null
cat /etc/config/netflixip.list | while read nip || [ -n "$nip" ];
do
cat /etc/config/netflixip.list | while read nip || [ -n "$nip" ]; do
ipset add netflix $nip 2>/dev/null
done
fi
else
rm -f /tmp/dnsmasq.ssr/netflix_forward.conf
fi
/etc/init.d/dnsmasq restart >/dev/null 2>&1
fi
start_server
......@@ -756,5 +752,3 @@ stop() {
fi
del_cron
}
......@@ -13,8 +13,17 @@ uci -q batch <<-EOF >/dev/null
commit firewall
EOF
killall -q -9 ssr-monitor ss-redir ssr-redir ss-local ssr-local obfs-local v2ray-plugin v2ray trojan ipt2socks ssr-server kcptun-client dns2socks microsocks redsocks2
/usr/share/shadowsocksr/gfw2ipset.sh
touch /etc/china_ssr.txt
touch /etc/config/white.list
touch /etc/config/black.list
touch /etc/config/netflix.list
touch /etc/config/netflixip.list
touch /etc/dnsmasq.ssr/ad.conf
touch /etc/dnsmasq.ssr/gfw_list.conf
/etc/init.d/shadowsocksr enable
/etc/init.d/shadowsocksr stop
rm -rf /tmp/luci-modulecache/*
rm -f /tmp/luci-indexcache
exit 0
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册