Fix: Pass configuration to Newt via environment variables - v1.2.2

This commit is contained in:
Jørgen Ferdinand 2025-03-07 23:31:43 +01:00
parent 87becba6db
commit 1b81ddc678
2 changed files with 6 additions and 6 deletions

View file

@ -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:

View file

@ -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