Adds functions to check if config/var is equal to a value

This commit is contained in:
Franck Nijhof 2019-03-15 12:15:08 +01:00
parent 46aa0b1784
commit 7c7386b502
No known key found for this signature in database
GPG key ID: D62583BA8AB11CA3
2 changed files with 28 additions and 3 deletions

View file

@ -98,13 +98,15 @@ function bashio::var.is_empty() {
#
# Arguments:
# $1 Value
# $2 Equals value
# ------------------------------------------------------------------------------
function bashio::var.is_empty() {
function bashio::var.equals() {
local value=${1}
local equals=${2}
bashio::log.trace "${FUNCNAME[0]}:" "$@"
if [[ -z "${value}" ]]; then
if [[ "${value}" = "${equals}" ]]; then
return "${__BASHIO_EXIT_OK}"
fi