mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-23 09:11:50 +02:00
Check for secrets presence
This commit is contained in:
@@ -135,7 +135,7 @@ sed -i 's/: /=/' /tempenv
|
|||||||
|
|
||||||
# Look where secrets.yaml is located
|
# Look where secrets.yaml is located
|
||||||
SECRETSFILE="/config/secrets.yaml"
|
SECRETSFILE="/config/secrets.yaml"
|
||||||
if [ -f "$SECRETSFILE" ]; then SECRETSFILE="/homeassistant/secrets.yaml"; fi
|
if [ ! -f "$SECRETSFILE" ]; then SECRETSFILE="/homeassistant/secrets.yaml"; fi
|
||||||
|
|
||||||
while IFS= read -r line; do
|
while IFS= read -r line; do
|
||||||
# Skip empty lines
|
# Skip empty lines
|
||||||
@@ -146,6 +146,10 @@ while IFS= read -r line; do
|
|||||||
# Check if secret
|
# Check if secret
|
||||||
if [[ "${line}" == *'!secret '* ]]; then
|
if [[ "${line}" == *'!secret '* ]]; then
|
||||||
echo "secret detected"
|
echo "secret detected"
|
||||||
|
if [ ! -f "$SECRETSFILE" ]; then
|
||||||
|
bashio:log.fatal "Secrets file not found, ${line} skipped"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
secret=${line#*secret }
|
secret=${line#*secret }
|
||||||
# Check if single match
|
# Check if single match
|
||||||
secretnum=$(sed -n "/$secret:/=" "$SECRETSFILE")
|
secretnum=$(sed -n "/$secret:/=" "$SECRETSFILE")
|
||||||
|
|||||||
Reference in New Issue
Block a user