mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 02:11:01 +01:00
24 lines
774 B
Bash
24 lines
774 B
Bash
#!/usr/bin/with-contenv bashio
|
|
# shellcheck shell=bash
|
|
|
|
########
|
|
# MODE #
|
|
########
|
|
|
|
if [[ "$(bashio::config "Mode")" == Collector ]]; then
|
|
# Clean services
|
|
bashio::log.warning "Collector only mode. WebUI and Influxdb will be disabled"
|
|
rm -r /etc/services.d/influxdb
|
|
rm -r /etc/services.d/scrutiny
|
|
rm -r /etc/services.d/nginx
|
|
sed -i "/wait/d" /etc/services.d/collector-once/run
|
|
sed -i "/scrutiny api not ready/d" /etc/services.d/collector-once/run
|
|
|
|
# Check collector
|
|
if bashio::config.has_value "COLLECTOR_API_ENDPOINT"; then
|
|
echo "export COLLECTOR_API_ENDPOINT=$(bashio::config "COLLECTOR_API_ENDPOINT")" >> /env.sh
|
|
else
|
|
bashio::exit.nok "Mode is set to 'Collector', but 'COLLECTOR_API_ENDPOINT' is not defined"
|
|
fi
|
|
fi
|