Fix bashio issue and use environment variables - v1.1.5

This commit is contained in:
Jørgen Ferdinand 2025-03-07 23:06:50 +01:00
parent c90a505321
commit cc1cab7088
2 changed files with 7 additions and 4 deletions

View file

@ -1,5 +1,5 @@
name: "Newt Add-on" name: "Newt Add-on"
version: "1.1.4" version: "1.1.5"
slug: "newt" slug: "newt"
description: "Runs the Newt container inside Home Assistant using Supervisor API" description: "Runs the Newt container inside Home Assistant using Supervisor API"
arch: arch:

View file

@ -1,12 +1,15 @@
#!/usr/bin/env bash #!/usr/bin/env bash
source /usr/lib/bashio/bashio.sh
set -e # Stop script on errors set -e # Stop script on errors
echo "🔹 Starting Newt container using Home Assistant Supervisor API..." echo "🔹 Starting Newt container using Home Assistant Supervisor API..."
# Load config from Home Assistant options # Load config from Home Assistant options
PANGOLIN_ENDPOINT=$(bashio::config 'PANGOLIN_ENDPOINT') PANGOLIN_ENDPOINT=${PANGOLIN_ENDPOINT:-"https://dash.opland.net"}
NEWT_ID=$(bashio::config 'NEWT_ID') NEWT_ID=${NEWT_ID:-"ru32vsg8ls5lx93"}
NEWT_SECRET=$(bashio::config 'NEWT_SECRET') NEWT_SECRET=${NEWT_SECRET:-"5rbqgpc292989uk9kz52hmypoyz6u9jf7k670fqja8p4un8o"}
if [[ -z "$PANGOLIN_ENDPOINT" || -z "$NEWT_ID" || -z "$NEWT_SECRET" ]]; then if [[ -z "$PANGOLIN_ENDPOINT" || -z "$NEWT_ID" || -z "$NEWT_SECRET" ]]; then
echo "❌ ERROR: Missing configuration values!" echo "❌ ERROR: Missing configuration values!"