Skip to content

Instantly share code, notes, and snippets.

@Ali-Razmjoo
Last active December 15, 2023 02:11
Show Gist options
  • Save Ali-Razmjoo/688390e093d0605968e3777f6f889c19 to your computer and use it in GitHub Desktop.
Save Ali-Razmjoo/688390e093d0605968e3777f6f889c19 to your computer and use it in GitHub Desktop.
This script will download latest stable version of V2Ray and install/extract it in /usr/bin https://www.secologist.com/anonymous-v2ray-vpn
#!/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
unzip v2ray.zip -d /usr/bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment