mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-25 07:20:31 +02:00
Universal python
This commit is contained in:
@@ -27,6 +27,14 @@ for KEYS in "${arr[@]}"; do
|
|||||||
# Export the variable to run scripts
|
# 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/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
|
||||||
|
|
||||||
|
# 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
|
done
|
||||||
|
|
||||||
################
|
################
|
||||||
|
|||||||
Reference in New Issue
Block a user