Created
December 10, 2023 13:50
-
-
Save Ali-Razmjoo/9fbfea0bbcfe06c0b023e7a260e944d2 to your computer and use it in GitHub Desktop.
V2Ray and V2RayA Installer - https://www.secologist.com/anonymous-v2ray-vpn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
# Set DEBIAN_FRONTEND to noninteractive for fast the default configuration during installation | |
export DEBIAN_FRONTEND=noninteractive | |
# updating OS Packages | |
apt-get update | |
apt-get upgrade -y | |
# Installing required packages | |
apt-get install -y curl jq unzip --fix-missing | |
# get latest official release version from GitHub | |
export latest_version=$(curl -s https://api.github.com/repos/v2fly/v2ray-core/releases | jq -r '.[] | select(.prerelease==false) | .tag_name' | head -n 1) | |
# Determine system architecture | |
arch=$(uname -m) | |
# Set download URL based on architecture | |
if [ "$arch" = "aarch64" ]; then # ARM | |
download_url="https://github.com/v2fly/v2ray-core/releases/download/${latest_version}/v2ray-linux-arm64-v8a.zip" | |
else # Intel / AMD | |
download_url="https://github.com/v2fly/v2ray-core/releases/download/${latest_version}/v2ray-linux-64.zip" | |
fi | |
# Print the URL | |
echo $download_url; | |
# Download v2ray | |
curl -L $download_url -o v2ray.zip | |
# extract v2ray | |
unzip v2ray.zip -d /usr/bin | |
chmod +x /usr/bin/v2ray | |
rm -rf v2ray.zip | |
# Install v2rayA | |
curl -s https://apt.v2raya.org/key/public-key.asc | sudo tee /etc/apt/keyrings/v2raya.asc | |
echo "deb [signed-by=/etc/apt/keyrings/v2raya.asc] https://apt.v2raya.org/ v2raya main" | sudo tee /etc/apt/sources.list.d/v2raya.list | |
apt update | |
apt install v2raya -y | |
systemctl start v2raya.service | |
systemctl enable v2raya.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment