mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 02:11:01 +01:00
GitHub bot: fix linting issues (nobuild)
This commit is contained in:
12
.templates/01-config_yaml.sh
Executable file → Normal file
12
.templates/01-config_yaml.sh
Executable file → Normal file
@@ -164,10 +164,10 @@ if [ -f "$SECRETSFILE" ]; then SECRETSFILE="/homeassistant/secrets.yaml"; fi
|
|||||||
|
|
||||||
while IFS= read -r line; do
|
while IFS= read -r line; do
|
||||||
# Clean output
|
# Clean output
|
||||||
if [[ $line == \"*\" ]]; then
|
if [[ $line == \"*\" ]]; then
|
||||||
line="${line:1:-1}"
|
line="${line:1:-1}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if secret
|
# Check if secret
|
||||||
if [[ "${line}" == *'!secret '* ]]; then
|
if [[ "${line}" == *'!secret '* ]]; then
|
||||||
echo "secret detected"
|
echo "secret detected"
|
||||||
@@ -186,11 +186,11 @@ while IFS= read -r line; do
|
|||||||
KEYS="${line%%=*}"
|
KEYS="${line%%=*}"
|
||||||
VALUE="${line#*=}"
|
VALUE="${line#*=}"
|
||||||
line="${KEYS}='${VALUE}'"
|
line="${KEYS}='${VALUE}'"
|
||||||
export "${KEY}=${VALUE}"
|
export "${KEY}=${VALUE}"
|
||||||
# export to python
|
# export to python
|
||||||
if command -v "python3" &>/dev/null; then
|
if command -v "python3" &>/dev/null; then
|
||||||
[ ! -f /env.py ] && echo "import os" >/env.py
|
[ ! -f /env.py ] && echo "import os" >/env.py
|
||||||
echo "os.environ['${KEY}'] = '${VALUE//\'/\\\'}'" >> /env.py
|
echo "os.environ['${KEY}'] = '${VALUE//\'/\\\'}'" >>/env.py
|
||||||
python3 /env.py
|
python3 /env.py
|
||||||
fi
|
fi
|
||||||
# set .env
|
# set .env
|
||||||
@@ -201,7 +201,7 @@ while IFS= read -r line; do
|
|||||||
if cat /etc/services.d/*/*run* &>/dev/null; then sed -i "1a export $line" /etc/services.d/*/*run* 2>/dev/null; fi
|
if cat /etc/services.d/*/*run* &>/dev/null; then sed -i "1a export $line" /etc/services.d/*/*run* 2>/dev/null; fi
|
||||||
if cat /etc/cont-init.d/*run* &>/dev/null; then sed -i "1a export $line" /etc/cont-init.d/*run* 2>/dev/null; fi
|
if cat /etc/cont-init.d/*run* &>/dev/null; then sed -i "1a export $line" /etc/cont-init.d/*run* 2>/dev/null; fi
|
||||||
# For s6
|
# For s6
|
||||||
if [ -d /var/run/s6/container_environment ]; then printf "%s='%s'\n" "$KEY" "$VALUE" >> /etc/environment; fi
|
if [ -d /var/run/s6/container_environment ]; then printf "%s='%s'\n" "$KEY" "$VALUE" >>/etc/environment; fi
|
||||||
echo "export $line" >>~/.bashrc
|
echo "export $line" >>~/.bashrc
|
||||||
# Show in log
|
# Show in log
|
||||||
if ! bashio::config.false "verbose"; then bashio::log.blue "$line"; fi
|
if ! bashio::config.false "verbose"; then bashio::log.blue "$line"; fi
|
||||||
|
|||||||
Reference in New Issue
Block a user