Improvement

This commit is contained in:
Alexandre
2021-11-19 10:47:33 +01:00
parent 49f70cdd69
commit 7f3c0ebae3
5 changed files with 89 additions and 25 deletions

View File

@@ -26,11 +26,11 @@ fi
# Check if yaml is valid
EXIT_CODE=0
yamllint -d relaxed --no-warnings $CONFIGSOURCE &> ERROR || EXIT_CODE=$?
yamllint -d relaxed --no-warnings $CONFIGSOURCE &>ERROR || EXIT_CODE=$?
if [ $EXIT_CODE = 0 ]; then
echo "Config file is a valid yaml"
else
cat ERROR
cat ERROR
bashio::log.fatal "Config file has an invalid yaml format. Please check the file in $CONFIGSOURCE. Errors list above."
bashio::exit.nok
fi
@@ -66,7 +66,7 @@ bashio::log.info "Starting the app with the variables in /config/gazpar2mqtt"
for word in $(parse_yaml "$CONFIGSOURCE" ""); do
# Data validation
if [[ $word =~ ^.+[=].+$ ]]; then
$word=${word//\"}
$word=${word//[\"\']/}
export $word # Export the variable
bashio::log.blue "$word"
else