forked from webfsz/v2ry.fun
-
Notifications
You must be signed in to change notification settings - Fork 4
/
upgrade.sh
executable file
·56 lines (48 loc) · 1.4 KB
/
upgrade.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# 检查系统信息
if [ -f /etc/redhat-release ];then
OS='CentOS'
elif [ ! -z "`cat /etc/issue | grep bian`" ];then
OS='Debian'
elif [ ! -z "`cat /etc/issue | grep Ubuntu`" ];then
OS='Ubuntu'
else
echo "Not support OS, Please reinstall OS and retry!"
exit 1
fi
# 安装依赖
if [[ ${OS} == 'CentOS' ]];then
curl --silent --location https://rpm.nodesource.com/setup_8.x | bash -
yum install curl wget unzip git ntp ntpdate lrzsz python socat nodejs -y
npm install -g qrcode
else
curl -sL https://deb.nodesource.com/setup_8.x | bash -
apt-get update
apt-get install curl unzip git ntp wget ntpdate python socat lrzsz nodejs -y
npm install -g qrcode
fi
# 重装V2ray.fun
rm -rf /usr/local/v2ray.fun
cd /usr/local/
git clone https://github.com/tracyone/v2ray.fun
cd /usr/local/v2ray.fun/
chmod +x *.py
# 重装操作菜单
rm -rf /usr/local/bin/v2ray
ln -sf /usr/local/v2ray.fun/v2ray /usr/local/bin/
chmod +x /usr/local/bin/v2ray
# 更新Vray主程序
bash <(curl -L -s https://install.direct/go.sh)
# 初始化环境
python /usr/local/v2ray.fun/openport.py
service v2ray restart
cat /etc/rc.local | grep openport.py
if [[ $? -ne 0 ]]; then
cat>>/etc/rc.local<<EOF
python /usr/local/v2ray.fun/openport.py
EOF
chmod a+x /etc/rc.local
fi
clear
echo "脚本已更新!"