From 9a71576d5ec9e0d1a2669b7a99feb4378ff313bb Mon Sep 17 00:00:00 2001 From: Preston Ma Date: Mon, 21 Jan 2019 11:47:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A6=82=E6=9E=9C=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E5=89=8D=E5=AD=98=E5=9C=A8/etc/v2ray?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E4=BC=9A=E5=AF=BC=E8=87=B4git=20clone=20?= =?UTF-8?q?=E5=87=BA=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 重现方法 ``` mkdir -p /etc/v2ray/ cd /etc/v2ray/ bash <(curl -s -L https://233now.com/v2ray.sh) ``` 原因:740行的`[ -d /etc/v2ray ] && rm -rf /etc/v2ray`,如果恰好用户在当前这个目录,被删除后git就找不到了.. 解决:git clone时候先跳去别的目录,pushd/popd命令就比较合适了。 --- install.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install.sh b/install.sh index 48ca282..88276ac 100644 --- a/install.sh +++ b/install.sh @@ -752,11 +752,13 @@ install_v2ray() { mkdir -p /etc/v2ray/233boy/v2ray cp -rf $(pwd)/* /etc/v2ray/233boy/v2ray else + pushd /tmp if [[ $_test ]]; then git clone https://github.com/233boy/v2ray -b test /etc/v2ray/233boy/v2ray else git clone https://github.com/233boy/v2ray /etc/v2ray/233boy/v2ray fi + popd fi