#!/bin/bash # This script automatically downloads and installs the appropriate Netrinos client # for the current system architecture. It should be run with superuser privileges. # # Usage: # sudo ./netrinos-remote-deb-installer.sh [version] # # or directly from the shell with: # # sudo true; wget -O- https://dist.netrinos.com/linux/netrinos-remote-deb-installer.sh | sudo bash -s [version] # # The script first detects the system architecture, then downloads the appropriate # .deb package from the Netrinos distribution server. After downloading, it installs # the package using dpkg. # # examples: # netrinos-client-linux_daily_amd64.deb # netrinos-client_linux1.1.0_amd64.deb # Detect the system architecture detected_arch=$(uname -m) # Get the version from the command line argument, or use a default value version=${1:-latest} version=${version,,} # to lowercase # Define the base URL of the .deb packages base_url="https://dist.netrinos.com/linux" # If version = latest, set folder = latest case "$version" in beta) base_url="$base_url/beta" ;; daily) base_url="$base_url/daily" ;; latest) # latest is in main folder ;; *) base_url="$base_url/archive" ;; esac # Choose the appropriate .deb package based on the architecture case "$detected_arch" in x86_64) arch="amd64" ;; arm) arch="arm" ;; aarch64) arch="arm64" ;; armhf|armv6l|armv7l) arch="armhf" ;; *) echo "Unsupported architecture: $detected_arch" exit 1 ;; esac # Define the filename filename="netrinos-client-linux_${version}_${arch}.deb" # Define the URL url="$base_url/$filename" echo Using: $url # Define the temporary file tmpfile=$(mktemp) # Download the .deb package wget -O "$tmpfile" "$url" # Install the .deb package sudo dpkg -i "$tmpfile" # If dpkg reports an error due to missing dependencies, you can install them with apt: sudo apt-get install -f -y