From 4930d1c4c6279350eab12860feddc38e2278a4cf Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Tue, 22 Dec 2020 13:57:43 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20Update=20dns=20API=20methods=20(?= =?UTF-8?q?#37)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/dns.sh | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/lib/dns.sh b/lib/dns.sh index 1f66d97..9122151 100644 --- a/lib/dns.sh +++ b/lib/dns.sh @@ -119,19 +119,16 @@ function bashio::dns.version_latest() { # Checks if there is an update available for the DNS. # ------------------------------------------------------------------------------ function bashio::dns.update_available() { - local version - local version_latest + bashio::log.trace "${FUNCNAME[0]}" "$@" + 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]}" - - version=$(bashio::dns.version) - version_latest=$(bashio::dns.version_latest) - - if [[ "${version}" = "${version_latest}" ]]; then - return "${__BASHIO_EXIT_NOK}" - fi - - return "${__BASHIO_EXIT_OK}" + bashio::dns 'dns.info.locals' '.locals[]' } # ------------------------------------------------------------------------------