mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-03 14:24:06 +02:00
Update 00-global_var.sh
This commit is contained in:
@@ -41,7 +41,16 @@ for KEYS in "${arr[@]}"; do
|
|||||||
######################################
|
######################################
|
||||||
# Export the variable to run scripts #
|
# Export the variable to run scripts #
|
||||||
######################################
|
######################################
|
||||||
|
KEYS="${line%%=*}"
|
||||||
|
VALUE="${line#*=}"
|
||||||
|
line="${KEYS}='${VALUE}'"
|
||||||
export "$line"
|
export "$line"
|
||||||
|
# export to python
|
||||||
|
if command -v "python3" &>/dev/null; then
|
||||||
|
[ ! -f /env.py ] && echo "import os" > /env.py
|
||||||
|
echo "os.environ['${KEYS}'] = '${VALUE//[\"\']/}'" >> /env.py
|
||||||
|
python3 /env.py
|
||||||
|
fi
|
||||||
# set .env
|
# set .env
|
||||||
echo "$line" >> /.env || true
|
echo "$line" >> /.env || true
|
||||||
# set /etc/environment
|
# set /etc/environment
|
||||||
|
|||||||
Reference in New Issue
Block a user