mirror of
https://github.com/lush2020/edgetunnel.git
synced 2026-03-21 17:12:33 +08:00
45 lines
1.1 KiB
Bash
45 lines
1.1 KiB
Bash
#!/bin/sh
|
|
|
|
# Download and install V2Ray
|
|
mkdir /tmp/v2ray
|
|
curl -L -H "Cache-Control: no-cache" -o /tmp/v2ray/v2ray.zip https://github.com/v2fly/v2ray-core/releases/latest/download/v2ray-linux-64.zip
|
|
unzip /tmp/v2ray/v2ray.zip -d /tmp/v2ray
|
|
install -m 755 /tmp/v2ray/v2ray /usr/local/bin/v2ray
|
|
install -m 755 /tmp/v2ray/v2ctl /usr/local/bin/v2ctl
|
|
|
|
# Remove temporary directory
|
|
rm -rf /tmp/v2ray
|
|
|
|
# V2Ray new configuration
|
|
install -d /usr/local/etc/v2ray
|
|
cat << EOF > /usr/local/etc/v2ray/config.json
|
|
{
|
|
"inbounds": [
|
|
{
|
|
"port": $PORT,
|
|
"protocol": "vmess",
|
|
"settings": {
|
|
"clients": [
|
|
{
|
|
"id": "ce7ea10b-5b27-49ab-a93d-6b184df9cce9s",
|
|
"alterId": 64
|
|
}
|
|
],
|
|
"disableInsecureEncryption": true
|
|
},
|
|
"streamSettings": {
|
|
"network": "ws"
|
|
}
|
|
}
|
|
],
|
|
"outbounds": [
|
|
{
|
|
"protocol": "freedom"
|
|
}
|
|
]
|
|
}
|
|
EOF
|
|
|
|
# Run V2Ray
|
|
/usr/local/bin/v2ray -config /usr/local/etc/v2ray/config.json
|