luci-app-ssr-plus:hide ssr server option when shadowsocks-libev-ss-server is not installed

This commit is contained in:
lean 2020-04-15 20:42:20 +08:00
parent 2125e805d1
commit 7262d9503e

View File

@ -1,5 +1,8 @@
-- Copyright (C) 2017 yushi studio <ywb94@qq.com>
-- Licensed to the public under the GNU General Public License v3.
require "luci.http"
require "luci.dispatcher"
require "nixio.fs"
local m, s, o
local shadowsocksr = "shadowsocksr"
@ -61,8 +64,10 @@ o.default = 1
o.rmempty = false
o = s:option(ListValue, "type", translate("Server Type"))
o:value("ssr", translate("ShadowsocksR"))
o:value("socks5", translate("Socks5"))
if nixio.fs.access("/usr/bin/ss-server") then
o:value("ssr", translate("ShadowsocksR"))
end
o.default = "socks5"
o = s:option(Value, "server_port", translate("Server Port"))