-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxf.sh
65 lines (57 loc) · 1.39 KB
/
xf.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
57
58
59
60
61
62
63
64
65
#!/bin/sh
##
# Set ARG
ARCH="64"
DOWNLOAD_PATH="/tmp/v2ray"
mkdir -p ${DOWNLOAD_PATH}
cd ${DOWNLOAD_PATH} || exit
wget -O ${DOWNLOAD_PATH}/v2ray.zip https://github.com/v2fly/v2ray-core/releases/download/v4.45.2/v2ray-linux-64.zip
# Prepare
echo "Prepare to use"
unzip v2ray.zip && chmod +x v2ray v2ctl
mv v2ray v2ctl /usr/bin/
mv geosite.dat geoip.dat /usr/local/share/v2ray/
# mv config.json /etc/v2ray/config.json
# Set config file
cat <<EOF >/etc/v2ray/config.json
{
"log": {
"loglevel": "warning"
},
"inbounds": [
{
"listen": "0.0.0.0",
"port": 8080,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "482a3319-aa83-43fe-bc5d-3ae61b05d63f",
"alterId": 0
}
],
"disableInsecureEncryption": true
},
"streamSettings": {
"network": "ws"
}
}
],
"outbounds": [
{
"protocol": "freedom"
}
]
}
EOF
# Clean
cd ~ || return
rm -rf ${DOWNLOAD_PATH:?}/*
echo "Install done"
echo "--------------------------------"
echo "Fly App Name: ${FLY_APP_NAME}"
echo "Fly App Region: ${FLY_REGION}"
echo "V2Ray UUID: ${UUID}"
echo "--------------------------------"
# Run v2ray
/usr/bin/v2ray -config /etc/v2ray/config.json