Last active
December 15, 2023 02:11
-
-
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
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 | |
unzip v2ray.zip -d /usr/bin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment