-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathinstall.sh
38 lines (35 loc) · 962 Bytes
/
install.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
#!/bin/sh
echo '正在安装依赖'
if cat /etc/os-release | grep "centos" > /dev/null
then
yum install unzip wget -y > /dev/null
yum update curl -y
else
apt-get install unzip wget -y > /dev/null
apt-get update curl -y
fi
api=$1
key=$2
nodeId=$3
localPort=$4
license=$5
kill -9 $(ps -ef | grep $key | grep -v grep | grep -v bash | awk '{print $2}') 1 > /dev/null
kill -9 $(ps -ef | grep defunct | grep -v grep | awk '{print $2}') 1 > /dev/null
echo '结束进程'
rm -rf $key
mkdir $key
cd $key
wget https://github.com/deepbwork/v2board-server/raw/master/v2board-server
wget https://github.com/v2ray/v2ray-core/releases/latest/download/v2ray-linux-64.zip
unzip v2ray-linux-64.zip
chmod 755 *
nohup `pwd`/v2board-server -api=$api -token=$key -node=$nodeId -localport=$localPort -license=$license > v2board.log 2>&1 &
echo '部署完成'
sleep 3
cat v2board.log
if ls | grep "service.log"
then
cat service.log
else
echo '启动失败'
fi