From 1b81ddc6786ac02cca76da28de38549bbf0784ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Ferdinand?= Date: Fri, 7 Mar 2025 23:31:43 +0100 Subject: [PATCH] Fix: Pass configuration to Newt via environment variables - v1.2.2 --- newt/config.yaml | 2 +- newt/run.sh | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/newt/config.yaml b/newt/config.yaml index 8b51086..9562563 100644 --- a/newt/config.yaml +++ b/newt/config.yaml @@ -1,5 +1,5 @@ name: "Newt Add-on" -version: "1.2.1" +version: "1.2.2" slug: "newt" description: "Runs Newt inside Home Assistant OS" arch: diff --git a/newt/run.sh b/newt/run.sh index 43bf123..0899794 100644 --- a/newt/run.sh +++ b/newt/run.sh @@ -4,9 +4,9 @@ set -e # Stop the script on errors echo "🔹 Starting Newt inside Home Assistant OS..." # Load configuration from environment variables set by Home Assistant -PANGOLIN_ENDPOINT=${PANGOLIN_ENDPOINT} -NEWT_ID=${NEWT_ID} -NEWT_SECRET=${NEWT_SECRET} +export PANGOLIN_ENDPOINT=${PANGOLIN_ENDPOINT} +export NEWT_ID=${NEWT_ID} +export NEWT_SECRET=${NEWT_SECRET} # Validate if configuration values are provided if [[ -z "$PANGOLIN_ENDPOINT" || -z "$NEWT_ID" || -z "$NEWT_SECRET" ]]; then @@ -19,9 +19,9 @@ echo " PANGOLIN_ENDPOINT=$PANGOLIN_ENDPOINT" echo " NEWT_ID=$NEWT_ID" echo " NEWT_SECRET=$NEWT_SECRET" -# Run Newt inside the add-on container +# Run Newt inside the add-on container using environment variables echo "🔹 Running Newt..." -/usr/bin/newt --id "$NEWT_ID" --secret "$NEWT_SECRET" --endpoint "$PANGOLIN_ENDPOINT" & +PANGOLIN_ENDPOINT="$PANGOLIN_ENDPOINT" NEWT_ID="$NEWT_ID" NEWT_SECRET="$NEWT_SECRET" /usr/bin/newt & echo "✅ Newt is running!" exec tail -f /dev/null # Keep the add-on running