From 043912447eeef0f72c7e98131ffa0b368294eeae Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Fri, 18 Nov 2022 10:24:07 +0100 Subject: [PATCH] Create 90-run.sh --- scrutiny/rootfs/etc/cont-init.d/90-run.sh | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 scrutiny/rootfs/etc/cont-init.d/90-run.sh diff --git a/scrutiny/rootfs/etc/cont-init.d/90-run.sh b/scrutiny/rootfs/etc/cont-init.d/90-run.sh new file mode 100644 index 000000000..13ab868f1 --- /dev/null +++ b/scrutiny/rootfs/etc/cont-init.d/90-run.sh @@ -0,0 +1,24 @@ +#!/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 "COLECTORCOLLECTOR_API_ENDPOINT"; then + echo "export COLECTORCOLLECTOR_API_ENDPOINT=$(bashio::config "COLLECTOR_API_ENDPOINT")" >> /env.sh + else + bashio::exit.nok "Mode is set to 'Collector', but 'COLECTORCOLLECTOR_API_ENDPOINT' is not defined" + fi +fi +