luci-app-ssr-plus: revert /etc/ssr_ip

This commit is contained in:
lean 2020-03-26 19:19:02 +08:00 committed by CN_SZTL
parent 53693fbedb
commit 83b38d91cb
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
3 changed files with 5 additions and 7 deletions

View File

@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-ssr-plus
PKG_VERSION:=174
PKG_RELEASE:=9
PKG_RELEASE:=10
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
@ -58,6 +58,7 @@ define Build/Compile
endef
define Package/$(PKG_NAME)/conffiles
/etc/ssr_ip
/etc/china_ssr.txt
/etc/config/shadowsocksr
/etc/config/white.list

View File

@ -91,7 +91,7 @@ gen_config_file() {
if echo $hostip | grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$" >/dev/null; then
hostip=$hostip
else
hostip=$(cat /tmp/ssr_ip)
hostip=$(cat /etc/ssr_ip)
fi
fi
[ "$2" == "0" -a "$kcp_flag" == "1" ] && hostip="127.0.0.1"
@ -179,9 +179,9 @@ start_rules() {
else
server=$(ping $server -W 1 -s 1 -c 1 | grep PING | cut -d'(' -f 2 | cut -d')' -f1)
if echo $server | grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$" >/dev/null; then
echo $server >/tmp/ssr_ip
echo $server >/etc/ssr_ip
else
server=$(cat /tmp/ssr_ip)
server=$(cat /etc/ssr_ip)
fi
fi
kcp_server=$server

View File

@ -21,9 +21,6 @@ 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