mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-02-07 04:14:53 +01:00
Update 01-config_yaml.sh
This commit is contained in:
@@ -1,7 +1,14 @@
|
|||||||
#!/usr/bin/with-contenv bashio
|
#!/usr/bin/env bashio
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
# shellcheck disable=SC2155,SC1087,SC2163,SC2116,SC2086
|
|
||||||
set -e
|
#################
|
||||||
|
# CODE INJECTOR #
|
||||||
|
#################
|
||||||
|
|
||||||
|
# Any commands written in this bash script will be executed at addon start
|
||||||
|
# See guide here : https://github.com/alexbelgium/hassio-addons/wiki/Add%E2%80%90ons-feature-:-customisation
|
||||||
|
|
||||||
|
apk add yamllint || apt-get install -y yamllint
|
||||||
|
|
||||||
##################
|
##################
|
||||||
# INITIALIZATION #
|
# INITIALIZATION #
|
||||||
@@ -163,8 +170,6 @@ 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
|
||||||
# Clean output
|
|
||||||
line="${line//[\"\']/}"
|
|
||||||
# Check if secret
|
# Check if secret
|
||||||
if [[ "${line}" == *'!secret '* ]]; then
|
if [[ "${line}" == *'!secret '* ]]; then
|
||||||
echo "secret detected"
|
echo "secret detected"
|
||||||
@@ -182,7 +187,7 @@ while IFS= read -r line; do
|
|||||||
# extract keys and values
|
# extract keys and values
|
||||||
KEYS="${line%%=*}"
|
KEYS="${line%%=*}"
|
||||||
VALUE="${line#*=}"
|
VALUE="${line#*=}"
|
||||||
line="${KEYS}='${VALUE}'"
|
line="${KEYS}="${VALUE}"
|
||||||
export "$line"
|
export "$line"
|
||||||
# export to python
|
# export to python
|
||||||
if command -v "python3" &>/dev/null; then
|
if command -v "python3" &>/dev/null; then
|
||||||
|
|||||||
Reference in New Issue
Block a user