]> git.ipfire.org Git - people/stevee/network.git/blobdiff - src/functions/functions.zone
pppoe-server: Read configuration again
[people/stevee/network.git] / src / functions / functions.zone
index 58c034722e926b9976033ea2dff19b4a183117a6..9a47f67ab1f1d947524e0ef1d6586e65bc1158ad 100644 (file)
@@ -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 ]