luci-app-ssr-plus: sync with upstream source

This commit is contained in:
CN_SZTL 2020-08-10 19:57:59 +08:00
parent f745afb7fb
commit 3e187c76c5
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
4 changed files with 13 additions and 12 deletions

View File

@ -43,7 +43,7 @@ PKG_CONFIG_DEPENDS:= \
LUCI_TITLE:=SS/SSR/V2Ray/Trojan/Socks5/Tun LuCI interface
LUCI_PKGARCH:=all
LUCI_DEPENDS:=+shadowsocksr-libev-alt +ipset +ip-full +iptables-mod-tproxy +dnsmasq-full +coreutils +coreutils-base64 +pdnsd-alt +wget +lua +libuci-lua \
+microsocks +dns2socks +shadowsocks-libev-ss-local +shadowsocksr-libev-ssr-local +shadowsocks-libev-ss-redir +simple-obfs +tcpping +resolveip\
+microsocks +dns2socks +shadowsocks-libev-ss-local +shadowsocksr-libev-ssr-local +shadowsocks-libev-ss-redir +simple-obfs +tcping +resolveip\
+PACKAGE_$(PKG_NAME)_INCLUDE_V2ray_plugin:v2ray-plugin \
+PACKAGE_$(PKG_NAME)_INCLUDE_V2ray:v2ray \
+PACKAGE_$(PKG_NAME)_INCLUDE_Trojan:trojan \
@ -54,4 +54,4 @@ LUCI_DEPENDS:=+shadowsocksr-libev-alt +ipset +ip-full +iptables-mod-tproxy +dnsm
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature
# call BuildPackage - OpenWrt buildroot signature

View File

@ -49,7 +49,7 @@ function act_ping()
socket:close()
e.ping = luci.sys.exec("ping -c 1 -W 1 %q 2>&1 | grep -o 'time=[0-9]*.[0-9]' | awk -F '=' '{print$2}'" % domain)
if (e.ping == "") then
e.ping = luci.sys.exec(string.format("echo -n $(tcpping -c 1 -i 1 -p %s %s 2>&1 | grep -o 'ttl=[0-9]* time=[0-9]*.[0-9]' | awk -F '=' '{print$3}') 2>/dev/null",port, domain))
e.ping = luci.sys.exec(string.format("echo -n $(tcping -q -c 1 -i 1 -t 2 -p %s %s 2>&1 | grep -o 'time=[0-9]*' | awk -F '=' '{print $2}') 2>/dev/null",port, domain))
end
if (iret == 0) then
luci.sys.call(" ipset del ss_spec_wan_ac " .. domain)

View File

@ -11,13 +11,6 @@ set firewall.shadowsocksr.path=/var/etc/shadowsocksr.include
set firewall.shadowsocksr.reload=1
commit firewall
EOF
chmod 0755 /etc/init.d/shadowsocksr /usr/bin/ssr-* /usr/share/shadowsocksr/*.sh
chmod 0644 /etc/ssr/* \
/usr/share/shadowsocksr/*.lua \
/usr/share/rpcd/acl.d/luci-app-ssr-plus.json \
/usr/lib/lua/luci/model/cbi/shadowsocksr/*.lua \
/usr/lib/lua/luci/view/shadowsocksr/*.htm
chmod 0600 /etc/config/shadowsocksr
touch /etc/ssr/china_ssr.txt
touch /etc/ssr/white.list
touch /etc/ssr/black.list
@ -26,5 +19,13 @@ touch /etc/ssr/netflixip.list
touch /etc/ssr/ad.conf
touch /etc/ssr/gfw_list.conf
touch /etc/ssr/deny.list
#chmod 0755 /etc/init.d/shadowsocksr /usr/bin/ssr-* /usr/share/shadowsocksr/*.sh
#chmod 0644 /etc/ssr/* \
#/usr/share/shadowsocksr/*.lua \
#/usr/share/rpcd/acl.d/luci-app-ssr-plus.json \
#/usr/lib/lua/luci/controller/shadowsocksr.lua \
#/usr/lib/lua/luci/model/cbi/shadowsocksr/*.lua \
#/usr/lib/lua/luci/view/shadowsocksr/*.htm
#chmod 0600 /etc/config/shadowsocksr
rm -rf /tmp/luci-modulecache /tmp/luci-indexcache
exit 0

View File

@ -81,9 +81,9 @@ test_proxy() {
local serverport=$(uci_get_by_name $1 server_port)
ipset add ss_spec_wan_ac $servername 2>/dev/null
ret1=$?
ret=$(tcpping -c 3 -p $serverport $servername | grep 'loss' | awk -F ',' '{ print $3 }' | awk -F "%" '{ print $1 }' | awk -F "." '{ print $1 }')
ret=$(tcping -q -c 3 -i 1 -t 2 -p $serverport $servername)
#echo "$(date "+%Y-%m-%d %H:%M:%S") test_proxy> name: $servername, ret1: $ret1, ret: $ret" >> /tmp/ssrplus.log
if [ -z "$ret" ] || [ "$ret" -gt "50" ]; then
if [ "$ret" -gt "0" ]; then
[ "$ret1" == "0" ] && ipset del ss_spec_wan_ac $servername 2>/dev/null
return 1
fi