This commit is contained in:
Alexandre
2022-02-18 13:06:51 +01:00
parent ed9845962b
commit 3db34e34f2
12 changed files with 50 additions and 41 deletions

View File

@@ -12,15 +12,15 @@ if bashio::config.true 'mqtt_autodiscover'; then
# Get variables
bashio::log.info "... MQTT service found, fetching server detail (you can enter those manually in your config file) ..."
MQTT_HOST=$(bashio::services mqtt "host")
export MQTT_HOST
export MQTT_HOST
MQTT_PORT=$(bashio::services mqtt "port")
export MQTT_PORT
export MQTT_PORT
MQTT_SSL=$(bashio::services mqtt "ssl")
export MQTT_SSL
export MQTT_SSL
MQTT_USERNAME=$(bashio::services mqtt "username")
export MQTT_USERNAME
MQTT_PASSWORD=$(bashio::services mqtt "password")
export MQTT_PASSWORD
export MQTT_PASSWORD
# Export variables
for variables in "MQTT_HOST=$MQTT_HOST" "MQTT_PORT=$MQTT_PORT" "MQTT_SSL=$MQTT_SSL" "MQTT_USERNAME=$MQTT_USERNAME" "MQTT_PASSWORD=$MQTT_PASSWORD"; do
sed -i "1a export $variables" /etc/services.d/*/*run* 2>/dev/null || true