Actualiser cookcli/rootfs/etc/services.d/cookcli/run
This commit is contained in:
parent
ea53c407fb
commit
98ebbecda9
|
|
@ -1,14 +1,30 @@
|
|||
#!/usr/bin/with-contenv bashio
|
||||
set -e
|
||||
|
||||
# L'environnement est déjà initialisé par cont-init.d
|
||||
bashio::log.info "=== Démarrage du service CookCLI ==="
|
||||
|
||||
RECIPES_PATH=$(bashio::config 'recipes_path')
|
||||
PORT=9081
|
||||
LOG_LEVEL=$(bashio::config 'log_level')
|
||||
|
||||
exec /usr/local/bin/cook server "${RECIPES_PATH}" \
|
||||
# Récupérer le chemin Ingress
|
||||
INGRESS_TOKEN=$(bashio::config 'ingress_token')
|
||||
if [ -n "$INGRESS_TOKEN" ]; then
|
||||
INGRESS_PATH="/api/hassio_ingress/${INGRESS_TOKEN}"
|
||||
bashio::log.info "Chemin Ingress: ${INGRESS_PATH}"
|
||||
else
|
||||
INGRESS_PATH=""
|
||||
fi
|
||||
|
||||
bashio::log.info "Démarrage de CookCLI sur le port ${PORT}..."
|
||||
|
||||
# Si CookCLI supporte --base-path
|
||||
if [ -n "$INGRESS_PATH" ]; then
|
||||
exec cook server "${RECIPES_PATH}" \
|
||||
--port "${PORT}" \
|
||||
--host "0.0.0.0" \
|
||||
--url-prefix "${INGRESS_PATH}" \
|
||||
>> /proc/1/fd/1 2>&1
|
||||
else
|
||||
exec cook server "${RECIPES_PATH}" \
|
||||
--port "${PORT}" \
|
||||
--host "0.0.0.0" \
|
||||
>> /proc/1/fd/1 2>&1
|
||||
fi
|
||||
Loading…
Reference in a new issue