[fix] v2ray command not found

pull/68/head^2
233boy 6 years ago
parent ec9a353de1
commit b062531cd3
  1. 9
      install.sh
  2. 16
      v2ray.sh

@ -45,6 +45,7 @@ old_id="23332333-2333-2333-2333-233boy233boy"
v2ray_server_config="/etc/v2ray/config.json" v2ray_server_config="/etc/v2ray/config.json"
v2ray_client_config="/etc/v2ray/233blog_v2ray_config.json" v2ray_client_config="/etc/v2ray/233blog_v2ray_config.json"
backup="/etc/v2ray/233blog_v2ray_backup.conf" backup="/etc/v2ray/233blog_v2ray_backup.conf"
_v2ray_sh="/usr/local/sbin/v2ray"
transport=( transport=(
TCP TCP
@ -1205,8 +1206,8 @@ config() {
cp -f $v2ray_server_config_file $v2ray_server_config cp -f $v2ray_server_config_file $v2ray_server_config
cp -f $v2ray_client_config_file $v2ray_client_config cp -f $v2ray_client_config_file $v2ray_client_config
cp -f /etc/v2ray/233boy/v2ray/config/backup.conf $backup cp -f /etc/v2ray/233boy/v2ray/config/backup.conf $backup
cp -f /etc/v2ray/233boy/v2ray/v2ray.sh /usr/local/bin/v2ray cp -f /etc/v2ray/233boy/v2ray/v2ray.sh $_v2ray_sh
chmod +x /usr/local/bin/v2ray chmod +x $_v2ray_sh
local multi_port="${v2ray_dynamic_port_start_input}-${v2ray_dynamic_port_end_input}" local multi_port="${v2ray_dynamic_port_start_input}-${v2ray_dynamic_port_end_input}"
if [ $shadowsocks ]; then if [ $shadowsocks ]; then
@ -1856,7 +1857,7 @@ uninstall() {
[ $v2ray_pid ] && do_service stop v2ray [ $v2ray_pid ] && do_service stop v2ray
rm -rf /usr/bin/v2ray rm -rf /usr/bin/v2ray
rm -rf /usr/local/bin/v2ray rm -rf $_v2ray_sh
rm -rf /etc/v2ray rm -rf /etc/v2ray
rm -rf /var/log/v2ray rm -rf /var/log/v2ray
@ -1913,7 +1914,7 @@ uninstall() {
# [ $v2ray_pid ] && systemctl stop v2ray # [ $v2ray_pid ] && systemctl stop v2ray
[ $v2ray_pid ] && do_service stop v2ray [ $v2ray_pid ] && do_service stop v2ray
rm -rf /usr/bin/v2ray rm -rf /usr/bin/v2ray
rm -rf /usr/local/bin/v2ray rm -rf $_v2ray_sh
rm -rf /etc/v2ray rm -rf /etc/v2ray
rm -rf /var/log/v2ray rm -rf /var/log/v2ray
if [[ $systemd ]]; then if [[ $systemd ]]; then

@ -10,7 +10,7 @@ none='\e[0m'
# Root # Root
[[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1 [[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1
_version="v2.34" _version="v2.35"
cmd="apt-get" cmd="apt-get"
@ -83,6 +83,12 @@ v2ray_server_config="/etc/v2ray/config.json"
v2ray_client_config="/etc/v2ray/233blog_v2ray_config.json" v2ray_client_config="/etc/v2ray/233blog_v2ray_config.json"
v2ray_pid=$(ps ux | grep "/usr/bin/v2ray/v2ray" | grep -v grep | awk '{print $2}') v2ray_pid=$(ps ux | grep "/usr/bin/v2ray/v2ray" | grep -v grep | awk '{print $2}')
caddy_pid=$(pgrep "caddy") caddy_pid=$(pgrep "caddy")
_v2ray_sh="/usr/local/sbin/v2ray"
if [[ ! -f $_v2ray_sh ]]; then
mv -f /usr/local/bin/v2ray $_v2ray_sh
chmod +x $_v2ray_sh
fi
if [ $v2ray_pid ]; then if [ $v2ray_pid ]; then
v2ray_status="$green正在运行$none" v2ray_status="$green正在运行$none"
@ -2937,8 +2943,8 @@ update_v2ray.sh() {
echo echo
cd /etc/v2ray/233boy/v2ray cd /etc/v2ray/233boy/v2ray
git pull git pull
cp -f /etc/v2ray/233boy/v2ray/v2ray.sh /usr/local/bin/v2ray cp -f /etc/v2ray/233boy/v2ray/v2ray.sh $_v2ray_sh
chmod +x /usr/local/bin/v2ray chmod +x $_v2ray_sh
echo echo
echo -e "$green 更新成功啦...当前 V2Ray 管理脚本 版本: ${cyan}$latest_version$none" echo -e "$green 更新成功啦...当前 V2Ray 管理脚本 版本: ${cyan}$latest_version$none"
echo echo
@ -3027,7 +3033,7 @@ uninstall_v2ray() {
[ $v2ray_pid ] && do_service stop v2ray [ $v2ray_pid ] && do_service stop v2ray
rm -rf /usr/bin/v2ray rm -rf /usr/bin/v2ray
rm -rf /usr/local/bin/v2ray rm -rf $_v2ray_sh
rm -rf /etc/v2ray rm -rf /etc/v2ray
rm -rf /var/log/v2ray rm -rf /var/log/v2ray
@ -3083,7 +3089,7 @@ uninstall_v2ray() {
[ $v2ray_pid ] && do_service stop v2ray [ $v2ray_pid ] && do_service stop v2ray
rm -rf /usr/bin/v2ray rm -rf /usr/bin/v2ray
rm -rf /usr/local/bin/v2ray rm -rf $_v2ray_sh
rm -rf /etc/v2ray rm -rf /etc/v2ray
rm -rf /var/log/v2ray rm -rf /var/log/v2ray
if [[ $systemd ]]; then if [[ $systemd ]]; then

Loading…
Cancel
Save