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

@@ -41,6 +41,7 @@ if [[ "$(bashio::config "Mode")" == Collector ]]; then
echo "export COLLECTOR_API_ENDPOINT=$(bashio::config "COLLECTOR_API_ENDPOINT")" >> /env.sh
sed -i "1a export COLLECTOR_API_ENDPOINT=$(bashio::config "COLLECTOR_API_ENDPOINT")" /etc/services.d/collector-once/run
if [ -d /var/run/s6/container_environment ]; then printf "%s" "$COLLECTOR_API_ENDPOINT" > /var/run/s6/container_environment/COLLECTOR_API_ENDPOINT; fi
if [ -f ~/.bashrc ]; then printf "%s" "IN_BACKGROUND=\"$COLLECTOR_API_ENDPOINT\"" >> ~/.bashrc; fi
bashio::log.info "Using 'COLLECTOR_API_ENDPOINT' $(bashio::config "COLLECTOR_API_ENDPOINT")"
else
bashio::exit.nok "Mode is set to 'Collector', but 'COLLECTOR_API_ENDPOINT' is not defined"