🔨 Use new Bashio service availablity checks

This commit is contained in:
Franck Nijhof 2020-02-21 18:19:21 +01:00
parent 7d6f06ef34
commit 3309ec1baf
No known key found for this signature in database
GPG key ID: D62583BA8AB11CA3
2 changed files with 4 additions and 8 deletions

View file

@ -8,8 +8,8 @@ declare password
declare port
declare username
host=$(bashio::services "mqtt" "host")
if bashio::var.has_value "${host}"; then
if bashio::services.available "mqtt"; then
host=$(bashio::services "mqtt" "host")
password=$(bashio::services "mqtt" "password")
port=$(bashio::services "mqtt" "port")
username=$(bashio::services "mqtt" "username")
@ -24,6 +24,4 @@ if bashio::var.has_value "${host}"; then
ln -s /root/.config/mosquitto_sub /root/.config/mosquitto_pub
ln -s /root/.config/mosquitto_sub /root/.config/mosquitto_rr
else
bashio::log.info "The above error can be ignored if you don't have Mosquitto installed"
fi

View file

@ -8,8 +8,8 @@ declare password
declare port
declare username
host=$(bashio::services "mysql" "host")
if bashio::var.has_value "${host}"; then
if bashio::services.available "mysql"; then
host=$(bashio::services "mysql" "host")
password=$(bashio::services "mysql" "password")
port=$(bashio::services "mysql" "port")
username=$(bashio::services "mysql" "username")
@ -22,6 +22,4 @@ if bashio::var.has_value "${host}"; then
echo "port=${port}"
echo "user=\"${username}\""
} > /etc/mysql/conf.d/service.cnf
else
bashio::log.info "The above error can be ignored if you don't have MariaDB installed"
fi