Export variable to bashrc

This commit is contained in:
Alexandre
2023-04-24 12:18:38 +02:00
parent 1545c8f6c6
commit a76d60808b
15 changed files with 54 additions and 11 deletions

View File

@@ -51,6 +51,7 @@ for KEYS in "${arr[@]}"; do
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" "${VALUE}" > /var/run/s6/container_environment/"${KEYS}"; fi
if [ -f ~/.bashrc ]; then printf "%s" "${KEYS}=\"${VALUE}\"" >> ~/.bashrc; fi
done

View File

@@ -131,6 +131,7 @@ while IFS= read -r line; do
sed -i "1a export $KEYS=\'$VALUE\'" /scripts/*run* 2>/dev/null || true
# Export to s6
if [ -d /var/run/s6/container_environment ]; then printf "%s" "${VALUE}" > /var/run/s6/container_environment/"${KEYS}"; fi
if [ -f ~/.bashrc ]; then printf "%s" "${KEYS}=\"${VALUE}\"" >> ~/.bashrc; fi
# Show in log
if ! bashio::config.false "verbose"; then bashio::log.blue "$KEYS=\'$VALUE\'"; fi
else