#!/bin/bash set -e echo "==> Démarrage de Jellyfin sur 8096..." /jellyfin/jellyfin \ --datadir "${JELLYFIN_DATA_DIR}" \ --configdir "${JELLYFIN_CONFIG_DIR}" \ --cachedir "${JELLYFIN_CACHE_DIR}" \ --logdir "${JELLYFIN_LOG_DIR}" \ --ffmpeg "/usr/lib/jellyfin-ffmpeg/ffmpeg" & JELLYFIN_PID=$! echo "==> Attente que Jellyfin soit prêt sur 8096..." until curl -sf http://127.0.0.1:8096 > /dev/null 2>&1; do sleep 2 done echo "==> Jellyfin prêt — démarrage nginx sur 7860..." nginx -c /etc/nginx/jellyfin.conf if ! kill -0 "$(cat /tmp/nginx.pid 2>/dev/null)" 2>/dev/null; then echo "==> ERREUR: nginx n'a pas démarré !" exit 1 fi echo "==> nginx OK (pid $(cat /tmp/nginx.pid))" wait "$JELLYFIN_PID"