#!/bin/sh # Echofiles+ for Linux, in one command: # # curl -fsSL https://echofiles.app/install.sh | sh # # Downloads the right file for this computer, checks it, adds GTK 4 and # libadwaita if they are missing (that step asks for your password), installs # Echofiles+ for you in ~/.local, and opens it. set -e # all in one function, so the whole script has arrived before any of it runs main() { VERSION=1.0.3 BASE=${EFP_DOWNLOADS:-https://echofiles.app/downloads} case $(uname -m) in x86_64|amd64) ARCH=x86_64 ;; aarch64|arm64) ARCH=aarch64 ;; *) echo "Echofiles+ for Linux runs on 64-bit PCs and 64-bit ARM computers, not $(uname -m)." >&2; exit 1 ;; esac NAME=echofilesplus-$VERSION-$ARCH TMP=$(mktemp -d) trap 'rm -rf "$TMP"' EXIT fetch() { if command -v curl >/dev/null 2>&1; then curl -fsSL "$1" -o "$2" else wget -qO "$2" "$1" fi } echo "Downloading Echofiles+ $VERSION ($ARCH)..." fetch "$BASE/$NAME.tar.gz" "$TMP/$NAME.tar.gz" fetch "$BASE/$NAME.tar.gz.sha256" "$TMP/$NAME.tar.gz.sha256" (cd "$TMP" && sha256sum -c "$NAME.tar.gz.sha256" >/dev/null) || { echo "The download is damaged. Please try again." >&2; exit 1; } tar xzf "$TMP/$NAME.tar.gz" -C "$TMP" # stdin is this script when piped from curl, so keep it away from the installer; # sudo asks for the password on the terminal itself "$TMP/$NAME/install.sh"