diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/api/api.lua b/luci-app-passwall/luasrc/model/cbi/passwall/api/api.lua index 52bbb0fdc..47d08757f 100755 --- a/luci-app-passwall/luasrc/model/cbi/passwall/api/api.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/api/api.lua @@ -336,8 +336,10 @@ function get_bin_version_cache(file, cmd) return sys.exec("echo -n $(cat /tmp/etc/passwall_tmp/%s)" % md5) else local version = sys.exec(string.format("echo -n $(%s %s)", file, cmd)) - sys.call("echo '" .. version .. "' > " .. "/tmp/etc/passwall_tmp/" .. md5) - return version + if version and version ~= "" then + sys.call("echo '" .. version .. "' > " .. "/tmp/etc/passwall_tmp/" .. md5) + return version + end end end return "" @@ -350,7 +352,7 @@ end function get_v2ray_version(file) if file == nil then file = get_v2ray_path() end - local cmd = "-version | awk '{print $2}' | sed -n 1P" + local cmd = "version | awk '{print $2}' | sed -n 1P" return get_bin_version_cache(file, cmd) end diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/api/v2ray.lua b/luci-app-passwall/luasrc/model/cbi/passwall/api/v2ray.lua index c00bf1461..f64fc697b 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/api/v2ray.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/api/v2ray.lua @@ -7,7 +7,7 @@ local i18n = api.i18n local pre_release_url = "https://api.github.com/repos/v2fly/v2ray-core/releases?per_page=1" local release_url = "https://api.github.com/repos/v2fly/v2ray-core/releases/latest" -local api_url = release_url +local api_url = pre_release_url local app_path = api.get_v2ray_path() or "" function check_path() diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/server/api/app.lua b/luci-app-passwall/luasrc/model/cbi/passwall/server/api/app.lua index f9f034d37..c9f2c7701 100755 --- a/luci-app-passwall/luasrc/model/cbi/passwall/server/api/app.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/server/api/app.lua @@ -123,7 +123,7 @@ local function start() bin = ln_run("/usr/bin/" .. type .. "-server", type .. "-server", "-c " .. config_file .. " " .. udp_param, log_path) elseif type == "V2ray" then config = require(require_dir .. "v2ray").gen_config(user) - bin = ln_run(api.get_v2ray_path(), "v2ray", "-config=" .. config_file, log_path) + bin = ln_run(api.get_v2ray_path(), "v2ray", "run -config=" .. config_file, log_path) elseif type == "Xray" then config = require(require_dir .. "v2ray").gen_config(user) bin = ln_run(api.get_xray_path(), "xray", "-config=" .. config_file, log_path) diff --git a/luci-app-passwall/root/usr/share/passwall/app.sh b/luci-app-passwall/root/usr/share/passwall/app.sh index 1b9e6117c..2b59dca28 100755 --- a/luci-app-passwall/root/usr/share/passwall/app.sh +++ b/luci-app-passwall/root/usr/share/passwall/app.sh @@ -353,7 +353,8 @@ run_v2ray() { _extra_param="${_extra_param} -tcp_proxy_way $tcp_proxy_way" _extra_param="${_extra_param} -loglevel $loglevel" lua $API_GEN_V2RAY ${_extra_param} > $config_file - ln_run "$(first_type $(config_t_get global_app ${type}_file) ${type})" ${type} $log_file -config="$config_file" + [ "$type" = "xray" ] && ln_run "$(first_type $(config_t_get global_app ${type}_file) ${type})" ${type} $log_file -config="$config_file" + [ "$type" = "v2ray" ] && ln_run "$(first_type $(config_t_get global_app ${type}_file) ${type})" ${type} $log_file run -config="$config_file" } run_dns2socks() { @@ -436,7 +437,8 @@ run_socks() { local _extra_param="-local_http_port $http_port" } lua $API_GEN_V2RAY_PROTO -local_socks_port $socks_port ${_extra_param} -server_proto socks -server_address ${_socks_address} -server_port ${_socks_port} -server_username ${_socks_username} -server_password ${_socks_password} > $config_file - ln_run "$bin" $type $log_file -config="$config_file" + [ "$type" = "xray" ] && ln_run "$bin" $type $log_file -config="$config_file" + [ "$type" = "v2ray" ] && ln_run "$bin" $type $log_file run -config="$config_file" ;; v2ray|\ xray)