Allow s6 env support

This commit is contained in:
Alexandre
2023-02-12 11:55:38 +01:00
parent 0d697bcd4a
commit 86ba596ef5
12 changed files with 21 additions and 0 deletions

View File

@@ -40,6 +40,7 @@ if [[ "$(bashio::config "Mode")" == Collector ]]; then
if bashio::config.has_value "COLLECTOR_API_ENDPOINT"; 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 "$COLLECTOR_API_ENDPOINT" > /var/run/s6/container_environment/COLLECTOR_API_ENDPOINT; 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"