From: Michael Tremer Date: Sun, 16 Sep 2018 09:24:28 +0000 (+0200) Subject: pppoe-server: Read configuration again X-Git-Tag: 010~102 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=79b2155dfaad4cbc183c6b6eb727f26854f59b45;p=network.git pppoe-server: Read configuration again This was broken since config IDs have been introduced Signed-off-by: Michael Tremer --- diff --git a/src/functions/functions.zone b/src/functions/functions.zone index 58c03472..9a47f67a 100644 --- a/src/functions/functions.zone +++ b/src/functions/functions.zone @@ -1380,6 +1380,39 @@ zone_config_settings_destroy() { rm -f "${path}" } + +zone_config_find_by_hook() { + local zone="${1}" + assert isset zone + + local hook="${2}" + assert isset hook + + local config + for config in $(zone_configs_list "${zone}"); do + local h="$(zone_config_get_hook "${zone}" "${config}")" + + [[ "${hook}" = "${h}" ]] && echo "${config}" + done + + return ${EXIT_OK} +} + +zone_config_settings_read_by_hook() { + local zone="${1}" + assert isset zone + + local hook="${2}" + assert isset hook + + local config + for config in $(zone_config_find_by_hook "${zone}" "${hook}"); do + zone_config_settings_read "${zone}" "${config}" + done + + return ${EXIT_OK} +} + zone_port_settings_read() { assert [ $# -ge 2 ] diff --git a/src/ppp/pppoe-server b/src/ppp/pppoe-server index 96814653..e0c6b21a 100644 --- a/src/ppp/pppoe-server +++ b/src/ppp/pppoe-server @@ -34,7 +34,7 @@ assert zone_exists ${zone} action=${2} # Read the configuration file of this hook. -zone_config_settings_read "${zone}" "pppoe-server" +zone_config_settings_read_by_hook "${zone}" "pppoe-server" assert isset SUBNET pppd_options="${RUN_DIR}/${zone}/pppoe-server-options"