This patch just split the parsing of the cmd line
into a separate function to allowing an edit with the generic hook_edit function.
Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
fi
}
-hook_new() {
- local zone=${1}
- shift
-
+hook_parse_cmdline() {
while [ $# -gt 0 ]; do
case "${1}" in
--address=*)
if [ -n "${GATEWAY}" ]; then
GATEWAY=$(ipv6_format "${GATEWAY}")
fi
+}
+
+hook_new() {
+ local zone=${1}
+ shift
+
+ if ! hook_parse_cmdline $@; then
+ # Return an error if the parsing of the cmd line fails
+ return ${EXIT_ERROR}
+ fi
zone_config_settings_write "${zone}" "${HOOK}"