luci ssr plus: update kcptun path

This commit is contained in:
coolsnowwolf 2019-04-12 11:17:27 +08:00
parent 5fa08c60db
commit d4ab022705
7 changed files with 18 additions and 18 deletions

View File

@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-ssr-plus
PKG_VERSION:=1
PKG_RELEASE:=87
PKG_RELEASE:=88
PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray \

View File

@ -333,9 +333,9 @@ o.datatype = "port"
o.default = 1234
o.rmempty = false
if nixio.fs.access("/usr/bin/ssr-kcptun") then
if nixio.fs.access("/usr/bin/kcptun-client") then
kcp_enable = s:option(Flag, "kcp_enable", translate("KcpTun Enable"), translate("bin:/usr/bin/ssr-kcptun"))
kcp_enable = s:option(Flag, "kcp_enable", translate("KcpTun Enable"), translate("bin:/usr/bin/kcptun-client"))
kcp_enable.rmempty = true
kcp_enable.default = "0"
kcp_enable:depends("type", "ssr")
@ -345,7 +345,7 @@ o = s:option(Value, "kcp_port", translate("KcpTun Port"))
o.datatype = "port"
o.default = 4000
function o.validate(self, value, section)
local kcp_file="/usr/bin/ssr-kcptun"
local kcp_file="/usr/bin/kcptun-client"
local enable = kcp_enable:formvalue(section) or kcp_enable.disabled
if enable == kcp_enable.enabled then
if not fs.access(kcp_file) then

View File

@ -86,7 +86,7 @@ function o.cfgvalue(...)
return Value.cfgvalue(...) or "?"
end
if nixio.fs.access("/usr/bin/ssr-kcptun") then
if nixio.fs.access("/usr/bin/kcptun-client") then
o = s:option(DummyValue, "kcp_enable", translate("KcpTun"))
function o.cfgvalue(...)

View File

@ -30,7 +30,7 @@ bold_off = [[</strong>]]
local fs = require "nixio.fs"
local sys = require "luci.sys"
local kcptun_version=translate("Unknown")
local kcp_file="/usr/bin/ssr-kcptun"
local kcp_file="/usr/bin/kcptun-client"
if not fs.access(kcp_file) then
kcptun_version=translate("Not exist")
else
@ -74,7 +74,7 @@ if luci.sys.call("pidof ssr-local >/dev/null") == 0 then
sock5_run=1
end
if luci.sys.call("pidof ssr-kcptun >/dev/null") == 0 then
if luci.sys.call("pidof kcptun-client >/dev/null") == 0 then
kcptun_run=1
end
@ -138,7 +138,7 @@ s.value = translate("Not Running")
end
end
if nixio.fs.access("/usr/bin/ssr-kcptun") then
if nixio.fs.access("/usr/bin/kcptun-client") then
s=m:field(DummyValue,"kcp_version",translate("KcpTun Version"))
s.rawhtml = true
s.value =kcptun_version

View File

@ -139,8 +139,8 @@ msgstr "服务端配置"
msgid "KcpTun Enable"
msgstr "KcpTun 启用"
msgid "bin:/usr/bin/ssr-kcptun"
msgstr "二进制文件:/usr/bin/ssr-kcptun"
msgid "bin:/usr/bin/kcptun-client"
msgstr "二进制文件:/usr/bin/kcptun-client"
msgid "KcpTun Port"
msgstr "KcpTun 端口"
@ -152,7 +152,7 @@ msgid "KcpTun Password"
msgstr "KcpTun 密码"
msgid "Haven't a Kcptun executable file"
msgstr "不存在Kcptun可执行文件请下载Kcptun可执行文件并改名放入/usr/bin/ssr-kcptun"
msgstr "不存在Kcptun可执行文件请下载Kcptun可执行文件并改名放入/usr/bin/kcptun-client"
msgid "Not a Kcptun executable file"
msgstr "Kcptun可执行文件格式不正确请确认是否正确下载了路由器对应的可执行文件"

View File

@ -268,16 +268,16 @@ start_redir() {
#deal kcp
local kcp_enable=$(uci_get_by_name $GLOBAL_SERVER kcp_enable 0)
if [ $kcp_enable = "1" ] ;then
[ ! -f "/usr/bin/ssr-kcptun" ] && return 1
[ ! -f "/usr/bin/kcptun-client" ] && return 1
local kcp_str=`/usr/bin/ssr-kcptun -v |grep kcptun|wc -l`
local kcp_str=`/usr/bin/kcptun-client -v |grep kcptun|wc -l`
[ "0" = $kcp_str ] && return 1
local kcp_port=$(uci_get_by_name $GLOBAL_SERVER kcp_port)
local server_port=$(uci_get_by_name $GLOBAL_SERVER server_port)
local password=$(uci_get_by_name $GLOBAL_SERVER kcp_password)
local kcp_param=$(uci_get_by_name $GLOBAL_SERVER kcp_param)
[ "$password" != "" ] && password="--key "${password}
service_start /usr/bin/ssr-kcptun \
service_start /usr/bin/kcptun-client \
-r $kcp_server:$kcp_port \
-l :$server_port $password $kcp_param
kcp_enable_flag=1
@ -525,7 +525,7 @@ stop() {
killall -q -9 ssr-redir
killall -q -9 v2ray
killall -q -9 ssr-server
killall -q -9 ssr-kcptun
killall -q -9 kcptun-client
killall -q -9 ssr-local
if [ -f /var/run/pdnsd.pid ] ;then
kill $(cat /var/run/pdnsd.pid) >/dev/null 2>&1

View File

@ -94,13 +94,13 @@ do
fi
#kcptun
if [ $kcp_process -gt 0 ] ;then
icount=`ps -w | grep ssr-kcptun |grep -v grep| wc -l`
icount=`ps -w | grep kcptun-client |grep -v grep| wc -l`
if [ $icount -lt $kcp_process ] #如果进程挂掉就重启它
then
logger -t "$NAME" "ssr kcptun error.restart!"
killall -q -9 ssr-kcptun
killall -q -9 kcptun-client
( /usr/bin/ssr-kcptun -r $server:$kcp_port -l :$server_port $password $kcp_param &)
( /usr/bin/kcptun-client -r $server:$kcp_port -l :$server_port $password $kcp_param &)
fi
fi
#local