]> git.ipfire.org Git - network.git/blobdiff - src/header-config
bridge: Fix assertion for MTU
[network.git] / src / header-config
index 6341a22bd0774245ba0a055155ed2ddf206aaf08..4458eaa94862472c93d512520f95194a2733b1da 100644 (file)
 ###############################################################################
 
 hook_new() {
-       cmd_not_implemented
+       local zone="${1}"
+       shift
+
+       local id=$(zone_config_get_new_id ${zone})
+       log DEBUG "ID for the config is: ${id}"
+
+       # Parse command line arguments
+       if ! hook_parse_cmdline "${id}" "$@"; then
+               # Return an error if the parsing of the cmd line fails
+               return ${EXIT_ERROR}
+       fi
+
+       # Write configuration to disk
+       if ! zone_config_settings_write "${zone}" "${HOOK}"; then
+               return ${EXIT_ERROR}
+       fi
+
+       return ${EXIT_OK}
 }
 
 hook_edit() {
@@ -55,7 +72,7 @@ hook_edit() {
                return ${EXIT_ERROR}
        fi
 
-       if ! hook_parse_cmdline $@; then
+       if ! hook_parse_cmdline "${id}" "$@"; then
                # Return an error if the parsing of the cmd line fails
                return ${EXIT_ERROR}
        fi