OSDN Git Service

luci-app-v2ray-server: fix compatibility for v2ray-core v5
authorzxlhhyccc <45259624+zxlhhyccc@users.noreply.github.com>
Sun, 10 Apr 2022 15:56:55 +0000 (23:56 +0800)
committerTianling Shen <cnsztl@immortalwrt.org>
Sun, 10 Apr 2022 22:42:11 +0000 (06:42 +0800)
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
applications/luci-app-v2ray-server/luasrc/view/v2ray_server/v2ray.htm
applications/luci-app-v2ray-server/root/etc/init.d/v2ray_server

index 93bd187..e4ea5f4 100644 (file)
@@ -1,5 +1,5 @@
 <%
-local v2ray_version=luci.sys.exec("[ -f '/usr/bin/v2ray' ] && /usr/bin/v2ray -version | awk '{print $2}' | sed -n 1P")
+local v2ray_version=luci.sys.exec("[ -f '/usr/bin/v2ray' ] && /usr/bin/v2ray version | awk '{print $2}' | sed -n 1P")
 local dsp = require "luci.dispatcher"
 -%>
 
index d134ea8..cbc599d 100755 (executable)
@@ -26,7 +26,7 @@ gen_v2ray_config_file() {
                [ ! -f "$ret" ] && ret="/usr/bin/v2ray"
                cp -a $ret /var/v2server
        fi
-       /var/v2server -config $CONFIG_PATH/$1.json >/dev/null 2>&1 &
+       /var/v2server run -config $CONFIG_PATH/$1.json >/dev/null 2>&1 &
 }
 
 start_v2ray_server() {