###############################################################################
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() {
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