Add service available method (#23)

This commit is contained in:
Franck Nijhof 2020-02-20 20:23:11 +01:00 committed by GitHub
parent d4d6ab8136
commit d2adc84339
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -65,6 +65,24 @@ QUERY
return "${__BASHIO_EXIT_OK}"
}
# ------------------------------------------------------------------------------
# Check if this service is available.
#
# Arguments:
# $1 Service name
# ------------------------------------------------------------------------------
function bashio::services.available() {
local service=${1}
bashio::log.trace "${FUNCNAME[0]}:" "$@"
if ! bashio::services "${service}" > /dev/null 2>&1; then
return "${__BASHIO_EXIT_NOK}"
fi
return "${__BASHIO_EXIT_OK}"
}
# ------------------------------------------------------------------------------
# Publish a new configuration object for this service.
#