From 3309ec1baf746289828575fe60613bfce80b99c6 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Fri, 21 Feb 2020 18:19:21 +0100 Subject: [PATCH] :hammer: Use new Bashio service availablity checks --- vscode/rootfs/etc/cont-init.d/mosquitto.sh | 6 ++---- vscode/rootfs/etc/cont-init.d/mysql.sh | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/vscode/rootfs/etc/cont-init.d/mosquitto.sh b/vscode/rootfs/etc/cont-init.d/mosquitto.sh index 79be1ee..c853368 100644 --- a/vscode/rootfs/etc/cont-init.d/mosquitto.sh +++ b/vscode/rootfs/etc/cont-init.d/mosquitto.sh @@ -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 diff --git a/vscode/rootfs/etc/cont-init.d/mysql.sh b/vscode/rootfs/etc/cont-init.d/mysql.sh index e91f107..f70ba0b 100644 --- a/vscode/rootfs/etc/cont-init.d/mysql.sh +++ b/vscode/rootfs/etc/cont-init.d/mysql.sh @@ -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