#!/usr/bin/env bash # Audiofy – Installation per Einzeiler (holt das Repository und startet das passende Install-Skript): # # curl -fsSL https://git.wind8000.de/0/audiofy/raw/branch/main/install/get.sh | bash -s -- server # curl -fsSL https://git.wind8000.de/0/audiofy/raw/branch/main/install/get.sh | bash -s -- player # … | bash -s -- server --update später aktualisieren (holt den neuesten Stand) # # Die Quellen liegen danach in /usr/local/src/audiofy. Andere Quelle/Zweig: # AUDIOFY_REPO=https://…/audiofy.git AUDIOFY_BRANCH=main set -euo pipefail REPO="${AUDIOFY_REPO:-https://git.wind8000.de/0/audiofy.git}" ZWEIG="${AUDIOFY_BRANCH:-main}" QUELLE="${AUDIOFY_SRC:-/usr/local/src/audiofy}" ROLLE="${1:-}" [ $# -gt 0 ] && shift case "$ROLLE" in server|player) ;; *) echo "Aufruf: curl -fsSL …/install/get.sh | bash -s -- server|player [--update]" >&2; exit 1 ;; esac if [ "$(id -u)" -eq 0 ]; then SUDO=""; else command -v sudo >/dev/null || { echo "Bitte als root ausführen oder sudo installieren." >&2; exit 1; } SUDO="sudo" fi echo "==> Audiofy-Quellen holen ($REPO, Zweig $ZWEIG)" if ! command -v git >/dev/null; then $SUDO apt-get update -qq $SUDO env DEBIAN_FRONTEND=noninteractive apt-get install -y -qq git >/dev/null fi if [ -d "$QUELLE/.git" ]; then $SUDO git -C "$QUELLE" fetch -q --depth 1 origin "$ZWEIG" $SUDO git -C "$QUELLE" reset -q --hard FETCH_HEAD else $SUDO install -d -m 755 "$(dirname "$QUELLE")" $SUDO git clone -q --depth 1 --branch "$ZWEIG" "$REPO" "$QUELLE" fi echo " Stand: $($SUDO git -C "$QUELLE" log -1 --format='%h %s')" # Bei "curl | bash" ist die Standardeingabe das Skript selbst – Fragen müssen vom Terminal kommen. if { : /dev/null; then exec bash "$QUELLE/install/install-$ROLLE.sh" "$@" &2 exit 1 fi