mirror of
https://github.com/hassio-addons/bashio.git
synced 2025-05-06 12:01:25 +00:00
🔨 Update dns API methods (#37)
This commit is contained in:
parent
72d834e77b
commit
4930d1c4c6
1 changed files with 8 additions and 11 deletions
19
lib/dns.sh
19
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[]'
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue