With the new id function this function gets a zone name and a id, but hook_config_cmd needs also the name of the hook.
So this function now calls zone_config_get_hook_from_id to get the hook and calls then hook_config_cmd with the correct argument order.
Signed-off-by: Jonatan Schlag jonatan.schlag@ipfire.org --- src/header-zone | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/src/header-zone b/src/header-zone index fdd6e51..2e3fa09 100644 --- a/src/header-zone +++ b/src/header-zone @@ -225,7 +225,22 @@ hook_config_destroy() { }
hook_config_edit() { - hook_config_cmd "edit" "$@" + assert [ $# -eq 2 ] + local zone=${1} + # The id must be the id and not the hid. + local id=${2} + + shift 2 + + # Check if we get a valid id + if ! zone_config_id_is_valid ${zone} ${id}; then + log ERROR "ID: ${id} is not a valid id for zone ${zone}" + fi + + local hook=$(zone_config_get_hook_from_id ${zone} ${id}) + assert isset hook + + hook_config_cmd "edit" "${zone}" "${hook}" "${hook}.${id}" "$@" }
hook_config_show() {