#!/bin/sh # Trinetra installer: curl -fsSL https://www.infodivelabs.com/products/trinetra/install.sh | sudo sh # Downloads the release for this machine and runs `trinetra install --require-signed`, # which verifies both release signatures and every file hash before installing anything. # TRINETRA_VERSION=v1.2.3 pins a release; the default is the latest one. set -eu repo="https://github.com/InfoDiveLabs/trinetra/releases" version="${TRINETRA_VERSION:-latest}" say() { printf '%s\n' "trinetra: $*"; } die() { printf '%s\n' "trinetra: $*" >&2; exit 1; } [ "$(uname -s)" = "Linux" ] || die "Linux with systemd only; this is $(uname -s)." [ -d /run/systemd/system ] || die "systemd is not running on this machine." [ "$(id -u)" -eq 0 ] || die "run as root: curl -fsSL https://www.infodivelabs.com/products/trinetra/install.sh | sudo sh" case "$(uname -m)" in x86_64 | amd64) arch=linux-amd64 ;; aarch64 | arm64) arch=linux-arm64 ;; armv7l | armv7 | armv8l) arch=linux-arm ;; *) die "no build for $(uname -m); x86-64, ARM64 and ARMv7 are supported." ;; esac if command -v curl >/dev/null 2>&1; then fetch() { curl -fsSL -o "$2" "$1"; } elif command -v wget >/dev/null 2>&1; then fetch() { wget -q -O "$2" "$1"; } else die "needs curl or wget." fi if [ "$version" = "latest" ]; then base="$repo/latest/download" else base="$repo/download/$version" fi dir="$(mktemp -d)" trap 'rm -rf "$dir"' EXIT INT TERM cd "$dir" say "downloading $version for $arch" for b in trinetra trinetra-ctl trinetra-web; do fetch "$base/$b-$arch" "$b" || die "could not download $b-$arch from $base" done for f in manifest.json manifest.ci.sig manifest.maint.sig; do fetch "$base/$f" "$f" || die "could not download $f from $base" done chmod +x trinetra trinetra-ctl trinetra-web say "verifying signatures and installing" ./trinetra install --require-signed say "installed. Next, run the guided setup: sudo trinetra cli"