🔨 Update dns API methods (#37)

This commit is contained in:
Franck Nijhof 2020-12-22 13:57:43 +01:00 committed by GitHub
parent 72d834e77b
commit 4930d1c4c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -119,19 +119,16 @@ function bashio::dns.version_latest() {
# Checks if there is an update available for the DNS. # Checks if there is an update available for the DNS.
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
function bashio::dns.update_available() { function bashio::dns.update_available() {
local version bashio::log.trace "${FUNCNAME[0]}" "$@"
local version_latest bashio::cli 'dns.info.update_available' '.update_available // false'
}
# ------------------------------------------------------------------------------
# Returns a list of local DNS servers used by the DNS.
# ------------------------------------------------------------------------------
function bashio::dns.locals() {
bashio::log.trace "${FUNCNAME[0]}" bashio::log.trace "${FUNCNAME[0]}"
bashio::dns 'dns.info.locals' '.locals[]'
version=$(bashio::dns.version)
version_latest=$(bashio::dns.version_latest)
if [[ "${version}" = "${version_latest}" ]]; then
return "${__BASHIO_EXIT_NOK}"
fi
return "${__BASHIO_EXIT_OK}"
} }
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------