diff --git a/.templates/00-global_var.sh b/.templates/00-global_var.sh index 8f032234e..f361b23e2 100644 --- a/.templates/00-global_var.sh +++ b/.templates/00-global_var.sh @@ -27,6 +27,14 @@ for KEYS in "${arr[@]}"; do # Export the variable to run scripts 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 + + # export on python + if command -v "python3" &>/dev/null; then + [ ! -f /env.py ] && echo "import os" > /env.py + echo "os.environ['${line%%=*}'] = '${line#*=}'" >> /env.py + python3 /env.py + rm /env.py + fi done ################