From 1c31ac2b6d4b0a336850fb9fd12fadf5868cac4e Mon Sep 17 00:00:00 2001 From: Dominic Alexander Windolph Date: Sat, 17 Oct 2026 19:44:37 +0100 Subject: [PATCH] Installation per Einzeiler (curl | bash) install/get.sh holt das Repository nach /usr/local/src/audiofy und startet install-server.sh bzw. install-player.sh; Eingaben kommen vom Terminal. Co-Authored-By: Claude Opus 5.5 --- README.md | 25 ++++++++++++++++++++++--- install/get.sh | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 3 deletions(-) create mode 100755 install/get.sh diff --git a/README.md b/README.md index 6eb7d9a..f4b6cb0 100644 --- a/README.md +++ b/README.md @@ -41,8 +41,27 @@ Portfreigabe am Router. ## Installation -Repository auf das jeweilige Gerät holen (`git clone …`) und als Benutzer mit sudo-Rechten -(oder als root) ausführen. +**Per Einzeiler** – als Benutzer mit sudo-Rechten (oder als root) in einem Terminal: + +``` +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 +``` + +Das Startskript installiert bei Bedarf `git`, holt Audiofy nach `/usr/local/src/audiofy` und +startet das passende Install-Skript. Später aktualisieren: denselben Befehl mit `--update` +am Ende (`… | bash -s -- server --update`). + +Vorsichtiger – erst ansehen, dann ausführen: + +``` +curl -fsSLO https://git.wind8000.de/0/audiofy/raw/branch/main/install/get.sh +less get.sh +bash get.sh server # bzw. player +``` + +**Oder von Hand:** Repository klonen (`git clone https://git.wind8000.de/0/audiofy.git`) und +die Install-Skripte direkt starten: **1. Server** @@ -82,7 +101,7 @@ einschalten und den QR-Code zeigen oder ausdrucken. | Status | `systemctl status audiofy-web` (Server) · `systemctl status audiofy-controller raspotify` (Player) | | Logs live | `journalctl -u audiofy-web -f` · `journalctl -u audiofy-controller -f` | | Neustart | `sudo systemctl restart audiofy-web` bzw. `audiofy-controller` | -| Update | `git pull && install/install-server.sh --update` bzw. `install/install-player.sh --update` | +| Update | Einzeiler mit `--update` – oder im Repository `git pull && install/install-server.sh --update` bzw. `install/install-player.sh --update` | `--update` ersetzt nur Code, Python-Umgebung und Dienstdatei; Konfiguration, Datenbank, Caddy, Firewall und raspotify bleiben unverändert. diff --git a/install/get.sh b/install/get.sh new file mode 100755 index 0000000..05e6b39 --- /dev/null +++ b/install/get.sh @@ -0,0 +1,50 @@ +#!/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