#!/bin/sh # En-rads-install: # curl -fsSL https://gitea.brasse-pc.eu/brasse/tdarr-cli/raw/branch/master/install.sh | sh set -eu REPO="https://gitea.brasse-pc.eu/brasse/tdarr-cli" VER="${TDARRCTL_VERSION:-latest}" command -v python3 >/dev/null 2>&1 || { echo "fel: python3 krävs"; exit 1; } if command -v curl >/dev/null 2>&1; then DL="curl -fsSL -o"; else DL="wget -qO"; fi DEST="${TDARRCTL_INSTALL_DIR:-}" [ -z "$DEST" ] && { if [ "$(id -u)" -eq 0 ] || [ -w /usr/local/bin ]; then DEST=/usr/local/bin; else DEST="$HOME/.local/bin"; fi; } mkdir -p "$DEST" tmp="$(mktemp)"; trap 'rm -f "$tmp"' EXIT $DL "$tmp" "$REPO/releases/download/$VER/tdarrctl" chmod +x "$tmp" mv "$tmp" "$DEST/tdarrctl" 2>/dev/null || { command -v sudo >/dev/null && sudo mv "$tmp" "$DEST/tdarrctl"; } trap - EXIT echo "Installerat: $DEST/tdarrctl" case ":$PATH:" in *":$DEST:"*) ;; *) echo "OBS: lägg $DEST i PATH";; esac