From: Michael Tremer Date: Tue, 14 Apr 2015 12:32:33 +0000 (+0000) Subject: zone: Make zone_config_{read,write} behave the same as zone_port_{read,write} do X-Git-Url: http://git.ipfire.org/?p=people%2Fstevee%2Fnetwork.git;a=commitdiff_plain;h=c8132752efea22b4a902f6b503787c3fb0313e0a zone: Make zone_config_{read,write} behave the same as zone_port_{read,write} do --- diff --git a/src/functions/functions.zone b/src/functions/functions.zone index 6373ec7c..4874f388 100644 --- a/src/functions/functions.zone +++ b/src/functions/functions.zone @@ -1008,25 +1008,38 @@ function zone_settings_get() { } function zone_config_settings_read() { - assert [ $# -gt 2 ] + assert [ $# -ge 2 ] local zone="${1}" local config="${2}" shift 2 + local args + if [ $# -eq 0 ] && [ -n "${HOOK_CONFIG_SETTINGS}" ]; then + list_append args ${HOOK_CONFIG_SETTINGS} + else + list_append args $@ + fi + local path="$(zone_dir "${zone}")/configs/${config}" - settings_read "${path}" "$@" + settings_read "${path}" ${args} } function zone_config_settings_write() { - assert [ $# -gt 2 ] + assert [ $# -ge 2 ] local zone="${1}" local config="${2}" shift 2 + local args + if function_exists "hook_check_config_settings"; then + list_append args "--check=\"hook_check_config_settings\"" + fi + list_append args ${HOOK_CONFIG_SETTINGS} + local path="$(zone_dir "${zone}")/configs/${config}" - settings_write "${path}" "$@" + settings_write "${path}" ${args} } function zone_port_settings_read() {