27 lines
786 B
Plaintext
27 lines
786 B
Plaintext
#!/command/with-contenv bashio
|
|
set -e
|
|
|
|
bashio::log.info "=== Service Nginx pour l'Ingress ==="
|
|
|
|
# Attendre que CookCLI soit prêt
|
|
bashio::log.info "Attente du démarrage de CookCLI..."
|
|
MAX_RETRIES=30
|
|
RETRY_COUNT=0
|
|
|
|
while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do
|
|
if nc -z 127.0.0.1 9081 2>/dev/null; then
|
|
bashio::log.info "✅ CookCLI est prêt sur le port 9081"
|
|
break
|
|
fi
|
|
RETRY_COUNT=$((RETRY_COUNT + 1))
|
|
bashio::log.info "⏳ Attente de CookCLI... (${RETRY_COUNT}/${MAX_RETRIES})"
|
|
sleep 1
|
|
done
|
|
|
|
if [ $RETRY_COUNT -eq $MAX_RETRIES ]; then
|
|
bashio::log.warning "⚠️ CookCLI n'a pas démarré dans les délais, démarrage quand même..."
|
|
fi
|
|
|
|
# Démarrer Nginx
|
|
bashio::log.info "Démarrage de Nginx..."
|
|
exec nginx -g "daemon off;" >> /proc/1/fd/1 2>&1 |