Before a config is edit we should bring the config down and after up again. Also we need to have 2 arguments or more.
Signed-off-by: Jonatan Schlag jonatan.schlag@ipfire.org --- src/header-zone | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/header-zone b/src/header-zone index 2e3fa09..3b074ee 100644 --- a/src/header-zone +++ b/src/header-zone @@ -225,7 +225,7 @@ hook_config_destroy() { }
hook_config_edit() { - assert [ $# -eq 2 ] + assert [ $# -ge 2 ] local zone=${1} # The id must be the id and not the hid. local id=${2} @@ -240,7 +240,14 @@ hook_config_edit() { local hook=$(zone_config_get_hook_from_id ${zone} ${id}) assert isset hook
+ # Bring the config down + hook_config_cmd "down" "${zone}" "${hook}" "${hook}.${id}" + + # Edit the hook hook_config_cmd "edit" "${zone}" "${hook}" "${hook}.${id}" "$@" + + # Bring the config up again + hook_config_cmd "up" "${zone}" "${hook}" "${hook}.${id}" }
hook_config_show() {