fi
# If device is already attached, exit silently.
- if listmatch ${device} $(bridge_get_members ${bridge}); then
+ if list_match ${device} $(bridge_get_members ${bridge}); then
return ${EXIT_OK}
fi
fi
# If device is not attched, exit silently.
- if ! listmatch ${device} $(bridge_get_members ${bridge}); then
+ if ! list_match ${device} $(bridge_get_members ${bridge}); then
return ${EXIT_OK}
fi
local argument="${1}"
if [ -n "${argument}" ]; then
- if listmatch ${argument} help -h --help; then
+ if list_match ${argument} help -h --help; then
return ${EXIT_TRUE}
fi
fi
read yesno
# Check for "yes".
- if listmatch ${yesno} y Y yes YES Yes; then
+ if list_match ${yesno} y Y yes YES Yes; then
return ${EXIT_TRUE}
# Check for "no".
- elif listmatch ${yesno} n N no NO No; then
+ elif list_match ${yesno} n N no NO No; then
return ${EXIT_FALSE}
fi
done
;;
esac
- listmatch ${addr} $(device_get_addresses ${device})
+ list_match ${addr} $(device_get_addresses ${device})
}
device_get_addresses() {
while read -r arg; do
key=$(cli_get_key ${arg})
- if ! listmatch "${key}" ${FIREWALL_RULES_CONFIG_PARAMS}; then
+ if ! list_match "${key}" ${FIREWALL_RULES_CONFIG_PARAMS}; then
log WARNING "Unrecognized argument: ${arg}"
return ${EXIT_ERROR}
fi
assert isset proto
- listmatch ${proto} ${IP_SUPPORTED_PROTOCOLS}
+ list_match ${proto} ${IP_SUPPORTED_PROTOCOLS}
}
ip_is_valid() {
local _list k
for k in ${!list}; do
- listmatch ${k} $@ && continue
+ list_match ${k} $@ && continue
_list="${_list} ${k}"
done
assert isset zone
assert zone_exists ${zone}
- if listmatch ${port} $(zone_get_ports ${zone}); then
+ if list_match ${port} $(zone_get_ports ${zone}); then
echo "${zone}"
return ${EXIT_OK}
fi
for other_port in $(ports_get); do
[ "${other_port}" = "${port}" ] && continue
- if listmatch ${port} $(port_get_parents ${other_port}); then
+ if list_match ${port} $(port_get_parents ${other_port}); then
error_log "Cannot destroy port '${port}' which is a parent port to '${other_port}'."
ok=${EXIT_ERROR}
fi
- if listmatch ${port} $(port_get_children ${other_port}); then
+ if list_match ${port} $(port_get_children ${other_port}); then
error_log "Cannot destroy port '${port}' which is child of port '${other_port}'."
ok=${EXIT_ERROR}
fi
# If valid keys is set, key must be in the list.
if [ -n "${valid_keys}" ]; then
- if ! listmatch ${key} ${valid_keys}; then
+ if ! list_match ${key} ${valid_keys}; then
if ! enabled ignore_superfluous_settings; then
log DEBUG "Ignoring configuration setting: ${key}"
fi
# If valid_keys is set, key must be in the list.
if [ -n "${valid_keys}" ]; then
- if ! listmatch ${key} ${valid_keys}; then
+ if ! list_match ${key} ${valid_keys}; then
log DEBUG "Ignoring configuration setting: ${key}"
continue
fi
local mode=${2}
assert isset mode
- if ! listmatch ${mode} ${STP_ALLOWED_MODES}; then
+ if ! list_match ${mode} ${STP_ALLOWED_MODES}; then
log WARNING "Unknown protocol version: ${mode}."
log WARNING "Using default mode."
log WARNING "$@"
}
-# The next two functions are kept for backwards
-# compatibility. The need to be dropped at some time.
-listmatch() {
- list_match $@
-}
-
+# Deprecated
listlength() {
list_length $@
}