mirror of
https://github.com/hassio-addons/bashio.git
synced 2025-05-06 20:11:24 +00:00
✨ Add service available method (#23)
This commit is contained in:
parent
d4d6ab8136
commit
d2adc84339
1 changed files with 18 additions and 0 deletions
|
@ -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.
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue