Fix environment variable handling - version 1.0.3
This commit is contained in:
parent
2eaed37ef6
commit
e4d2b85013
2 changed files with 11 additions and 7 deletions
|
@ -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"
|
10
newt/run.sh
10
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)
|
||||
# Keep the script running
|
||||
exec tail -f /dev/null
|
Loading…
Add table
Add a link
Reference in a new issue