diff --git a/newt/config.yaml b/newt/config.yaml index 12c7c52..a2806d0 100644 --- a/newt/config.yaml +++ b/newt/config.yaml @@ -1,5 +1,5 @@ name: "Newt Add-on" -version: "1.0.2" +version: "1.0.3" slug: "newt" description: "Runs the Newt container inside Home Assistant" arch: @@ -21,3 +21,7 @@ schema: PANGOLIN_ENDPOINT: "str?" NEWT_ID: "str?" NEWT_SECRET: "str?" +environment: + PANGOLIN_ENDPOINT: "$PANGOLIN_ENDPOINT" + NEWT_ID: "$NEWT_ID" + NEWT_SECRET: "$NEWT_SECRET" \ No newline at end of file diff --git a/newt/run.sh b/newt/run.sh index 2f6bd8a..5902f76 100644 --- a/newt/run.sh +++ b/newt/run.sh @@ -3,10 +3,10 @@ set -e echo "Starting Newt container..." -# Load config from Home Assistant options -PANGOLIN_ENDPOINT=$(bashio::config 'PANGOLIN_ENDPOINT') -NEWT_ID=$(bashio::config 'NEWT_ID') -NEWT_SECRET=$(bashio::config 'NEWT_SECRET') +# Load config from environment variables +PANGOLIN_ENDPOINT=${PANGOLIN_ENDPOINT:-"https://example.com"} +NEWT_ID=${NEWT_ID:-"default_id"} +NEWT_SECRET=${NEWT_SECRET:-"default_secret"} # Ensure Docker is running if ! docker info >/dev/null 2>&1; then @@ -30,5 +30,5 @@ docker run -d --restart unless-stopped \ echo "Newt container is running!" -# Prevent the script from exiting (Keeps the add-on running) -exec tail -f /dev/null \ No newline at end of file +# Keep the script running +exec tail -f /dev/null