mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-02 22:04:06 +02:00
Update 99-run.sh
This commit is contained in:
@@ -68,21 +68,21 @@ parse_yaml "$CONFIGSOURCE" "" >/tmpfile
|
|||||||
while IFS= read -r line
|
while IFS= read -r line
|
||||||
do
|
do
|
||||||
# Clean output
|
# Clean output
|
||||||
word=${word//[\"\']/}
|
line=${line//[\"\']/}
|
||||||
# Check if secret
|
# Check if secret
|
||||||
if [[ "${word}" == *'!secret '* ]]; then
|
if [[ "${line}" == *'!secret '* ]]; then
|
||||||
secret=${word#*secret }
|
secret=${line#*secret }
|
||||||
secret=$(sed "/$secret/!d" /config/secrets.yaml)
|
secret=$(sed "/$secret/!d" /config/secrets.yaml)
|
||||||
secret=${secret#*: }
|
secret=${secret#*: }
|
||||||
word="${word%%=*}=$secret"
|
word="${line%%=*}=$secret"
|
||||||
fi
|
fi
|
||||||
# Data validation
|
# Data validation
|
||||||
if [[ $word =~ ^.+[=].+$ ]]; then
|
if [[ $line =~ ^.+[=].+$ ]]; then
|
||||||
export $word # Export the variable
|
export $line # Export the variable
|
||||||
bashio::log.blue "$word"
|
bashio::log.blue "$line"
|
||||||
else
|
else
|
||||||
bashio::log.fatal "$word does not follow the structure KEY=text, it will be ignored and removed from the config"
|
bashio::log.fatal "$line does not follow the structure KEY=text, it will be ignored and removed from the config"
|
||||||
sed -i "/$word/ d" ${CONFIGSOURCE}
|
sed -i "/$line/ d" ${CONFIGSOURCE}
|
||||||
fi
|
fi
|
||||||
done < "/tmpfile"
|
done < "/tmpfile"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user