From d0a936920fe43e96d515209daa750cae7e1d3a42 Mon Sep 17 00:00:00 2001 From: 233boy <31657650+233boy@users.noreply.github.com> Date: Fri, 9 Sep 2022 00:20:56 +0800 Subject: [PATCH] fix v2 ver args err --- v2ray.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/v2ray.sh b/v2ray.sh index ea172b1..3f7f1f3 100644 --- a/v2ray.sh +++ b/v2ray.sh @@ -10,7 +10,7 @@ none='\e[0m' # Root [[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1 -_version="v3.58" +_version="v3.59" cmd="apt-get" @@ -84,7 +84,14 @@ v2ray_client_config="/etc/v2ray/233blog_v2ray_config.json" v2ray_pid=$(pgrep -f /usr/bin/v2ray/v2ray) caddy_pid=$(pgrep -f /usr/local/bin/caddy) _v2ray_sh="/usr/local/sbin/v2ray" -v2ray_ver="$(/usr/bin/v2ray/v2ray -version | head -n 1 | cut -d " " -f2)" + +/usr/bin/v2ray/v2ray -version >/dev/null 2>&1 +if [[ $? == 0 ]]; then + v2ray_ver="$(/usr/bin/v2ray/v2ray -version | head -n 1 | cut -d " " -f2)" +else + v2ray_ver="$(/usr/bin/v2ray/v2ray version | head -n 1 | cut -d " " -f2)" +fi + . /etc/v2ray/233boy/v2ray/src/init.sh systemd=true # _test=true