Umbenennung: Audiofy heißt jetzt Playwish
Name, Seitentitel, Dienste (playwish-web, playwish-controller), Dienst-Benutzer (playwish), Pfade (/opt/playwish, /usr/local/src/playwish), Vorlagen und Repository-Adresse. „Audiofy“ war bereits von mehreren Produkten belegt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+22
-22
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Audiofy – Installation der Rolle "Player": Spotify-Connect-Gerät (raspotify) und Controller.
|
||||
# Playwish – Installation der Rolle "Player": Spotify-Connect-Gerät (raspotify) und Controller.
|
||||
#
|
||||
# install/install-player.sh Neuinstallation (fragt alles Nötige ab)
|
||||
# install/install-player.sh --update nur Code, Python-Umgebung und Dienst aktualisieren
|
||||
@@ -20,23 +20,23 @@ for arg in "$@"; do
|
||||
esac
|
||||
done
|
||||
|
||||
KONFIG="$AUDIOFY_DIR/config"
|
||||
KONFIG="$PLAYWISH_DIR/config"
|
||||
ENV_DATEI="$KONFIG/.env"
|
||||
RASPOTIFY_CONF=/etc/raspotify/conf
|
||||
export AUDIOFY_DIR AUDIOFY_USER
|
||||
export PLAYWISH_DIR PLAYWISH_USER
|
||||
|
||||
schritt "Audiofy-Player: $([ $UPDATE = 1 ] && echo Update || echo Neuinstallation)"
|
||||
schritt "Playwish-Player: $([ $UPDATE = 1 ] && echo Update || echo Neuinstallation)"
|
||||
pruefe_system
|
||||
ARCH="$(dpkg --print-architecture)"
|
||||
case "$ARCH" in arm64|armhf|amd64) ;; *) abbruch "raspotify gibt es nicht für $ARCH (nur arm64, armhf, amd64)." ;; esac
|
||||
if [ $UPDATE = 1 ] && ! $SUDO test -f "$ENV_DATEI"; then
|
||||
abbruch "Keine bestehende Installation in $AUDIOFY_DIR gefunden – ohne --update ausführen."
|
||||
abbruch "Keine bestehende Installation in $PLAYWISH_DIR gefunden – ohne --update ausführen."
|
||||
fi
|
||||
|
||||
# ------------------------------------------------------------------ Abfragen
|
||||
if [ $UPDATE = 0 ]; then
|
||||
schritt "Angaben"
|
||||
frage GERAETENAME "Name des Spotify-Connect-Geräts" "Audiofy"
|
||||
frage GERAETENAME "Name des Spotify-Connect-Geräts" "Playwish"
|
||||
echo " Audio-Ausgabe: 1) Bluetooth-Lautsprecher 2) Kabel/HDMI/USB (ALSA)"
|
||||
frage AUSGABE "Auswahl" "1"
|
||||
if [ "$AUSGABE" = 2 ]; then
|
||||
@@ -50,7 +50,7 @@ if [ $UPDATE = 0 ]; then
|
||||
BLUETOOTH=1
|
||||
ALSA_GERAET="bluealsa:DEV=00:00:00:00:00:00,PROFILE=a2dp" # = zuletzt verbundener Lautsprecher
|
||||
fi
|
||||
frage SERVER_URL "Adresse des Audiofy-Servers (leer = ohne Wünsche, nur Playlist)" ""
|
||||
frage SERVER_URL "Adresse des Playwish-Servers (leer = ohne Wünsche, nur Playlist)" ""
|
||||
SERVER_URL="${SERVER_URL%/}"
|
||||
PLAYER_TOKEN=""
|
||||
[ -n "$SERVER_URL" ] && frage_geheim PLAYER_TOKEN "PLAYER_API_TOKEN vom Server (verdeckt)"
|
||||
@@ -102,7 +102,7 @@ if [ $UPDATE = 0 ]; then
|
||||
info "Name „$GERAETENAME“, Ausgabe $ALSA_GERAET"
|
||||
fi
|
||||
$SUDO install -d /etc/systemd/system/raspotify.service.d
|
||||
vorlage raspotify-10-audiofy.conf /etc/systemd/system/raspotify.service.d/10-audiofy.conf
|
||||
vorlage raspotify-10-playwish.conf /etc/systemd/system/raspotify.service.d/10-playwish.conf
|
||||
$SUDO systemctl daemon-reload
|
||||
$SUDO systemctl enable raspotify >/dev/null 2>&1
|
||||
[ $UPDATE = 0 ] && $SUDO systemctl restart raspotify
|
||||
@@ -144,16 +144,16 @@ fi
|
||||
# ------------------------------------------------------------------ Benutzer, Ordner, Code
|
||||
schritt "Dienst-Benutzer, Ordner und Code"
|
||||
dienst_benutzer
|
||||
$SUDO install -d -o root -g "$AUDIOFY_USER" -m 750 "$AUDIOFY_DIR"
|
||||
$SUDO install -d -o "$AUDIOFY_USER" -g "$AUDIOFY_USER" -m 700 "$KONFIG"
|
||||
code_kopieren "$REPO/player" "$AUDIOFY_DIR/app"
|
||||
venv_einrichten "$AUDIOFY_DIR/app/requirements.txt"
|
||||
info "Code in $AUDIOFY_DIR/app, Konfiguration in $KONFIG"
|
||||
$SUDO install -d -o root -g "$PLAYWISH_USER" -m 750 "$PLAYWISH_DIR"
|
||||
$SUDO install -d -o "$PLAYWISH_USER" -g "$PLAYWISH_USER" -m 700 "$KONFIG"
|
||||
code_kopieren "$REPO/player" "$PLAYWISH_DIR/app"
|
||||
venv_einrichten "$PLAYWISH_DIR/app/requirements.txt"
|
||||
info "Code in $PLAYWISH_DIR/app, Konfiguration in $KONFIG"
|
||||
|
||||
# ------------------------------------------------------------------ Konfiguration
|
||||
schritt "Konfiguration ($ENV_DATEI)"
|
||||
if [ $UPDATE = 0 ]; then
|
||||
$SUDO test -f "$ENV_DATEI" || $SUDO install -o "$AUDIOFY_USER" -g "$AUDIOFY_USER" -m 600 /dev/null "$ENV_DATEI"
|
||||
$SUDO test -f "$ENV_DATEI" || $SUDO install -o "$PLAYWISH_USER" -g "$PLAYWISH_USER" -m 600 /dev/null "$ENV_DATEI"
|
||||
env_setzen "$ENV_DATEI" SPOTIFY_CLIENT_ID "$SPOTIFY_CLIENT_ID"
|
||||
env_setzen "$ENV_DATEI" SPOTIFY_CLIENT_SECRET "$SPOTIFY_CLIENT_SECRET"
|
||||
env_setzen "$ENV_DATEI" SPOTIFY_REDIRECT_URI "http://127.0.0.1:8888/callback"
|
||||
@@ -170,7 +170,7 @@ if [ $UPDATE = 0 ]; then
|
||||
schritt "Spotify-Login für die Wiedergabe-Steuerung"
|
||||
info "Öffne gleich die angezeigte Adresse im Browser, melde dich an und füge danach die"
|
||||
info "Adresse aus der Adresszeile (http://127.0.0.1:8888/callback?...) hier ein."
|
||||
"${ALS_DIENST[@]}" "$AUDIOFY_DIR/.venv/bin/python" "$AUDIOFY_DIR/app/auth.py" --profil player --env "$ENV_DATEI" \
|
||||
"${ALS_DIENST[@]}" "$PLAYWISH_DIR/.venv/bin/python" "$PLAYWISH_DIR/app/auth.py" --profil player --env "$ENV_DATEI" \
|
||||
|| warnung "Login fehlgeschlagen – später nachholen (siehe README)."
|
||||
else
|
||||
# alte Schlüsselnamen übernehmen
|
||||
@@ -179,18 +179,18 @@ else
|
||||
fi
|
||||
|
||||
# ------------------------------------------------------------------ Dienst
|
||||
schritt "Dienst audiofy-controller"
|
||||
vorlage audiofy-controller.service /etc/systemd/system/audiofy-controller.service
|
||||
schritt "Dienst playwish-controller"
|
||||
vorlage playwish-controller.service /etc/systemd/system/playwish-controller.service
|
||||
$SUDO systemctl daemon-reload
|
||||
$SUDO systemctl enable audiofy-controller >/dev/null 2>&1
|
||||
$SUDO systemctl restart audiofy-controller
|
||||
$SUDO systemctl enable playwish-controller >/dev/null 2>&1
|
||||
$SUDO systemctl restart playwish-controller
|
||||
sleep 5
|
||||
systemctl is-active --quiet audiofy-controller || abbruch "audiofy-controller läuft nicht – siehe: journalctl -u audiofy-controller"
|
||||
info "audiofy-controller läuft"
|
||||
systemctl is-active --quiet playwish-controller || abbruch "playwish-controller läuft nicht – siehe: journalctl -u playwish-controller"
|
||||
info "playwish-controller läuft"
|
||||
|
||||
# ------------------------------------------------------------------ Zusammenfassung
|
||||
schritt "Fertig"
|
||||
info "Logs: journalctl -u audiofy-controller -f · journalctl -u raspotify -f"
|
||||
info "Logs: journalctl -u playwish-controller -f · journalctl -u raspotify -f"
|
||||
if [ $UPDATE = 0 ]; then
|
||||
info ""
|
||||
info "Wichtig: Wähle das Gerät „$GERAETENAME“ EINMAL in der Spotify-App aus (im selben Netz)."
|
||||
|
||||
Reference in New Issue
Block a user