Alexandre
2025-07-03 10:33:35 +02:00
committed by GitHub
parent 866255912a
commit 64d69c1ecf

View File

@@ -186,11 +186,11 @@ while IFS= read -r line; do
KEYS="${line%%=*}"
VALUE="${line#*=}"
line="${KEYS}='${VALUE}'"
export "${KEY}=${VALUE}"
export "${KEYS}=${VALUE}"
# export to python
if command -v "python3" &>/dev/null; then
[ ! -f /env.py ] && echo "import os" >/env.py
echo "os.environ['${KEY}'] = '${VALUE//\'/\\\'}'" >>/env.py
echo "os.environ['${KEYS}'] = '${VALUE//\'/\\\'}'" >>/env.py
python3 /env.py
fi
# 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/cont-init.d/*run* &>/dev/null; then sed -i "1a export $line" /etc/cont-init.d/*run* 2>/dev/null; fi
# 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" "$KEYS" "$VALUE" >>/etc/environment; fi
echo "export $line" >>~/.bashrc
# Show in log
if ! bashio::config.false "verbose"; then bashio::log.blue "$line"; fi