The syntax to edit a config is now
network zone upl0 config <id> edit
similar to the syntax if a zone is edited.
The cmd variable is setted to the content of ${1},
because we need the content in this variable if the ${id} is not valid, to print a nice error message.
Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
zone_config_edit "${zone}" "$@"
;;
*)
- error "Unrecognized argument: ${cmd}"
- cli_usage root-zone-config-subcommands
- exit ${EXIT_ERROR}
+ # Check is we get a valid id
+ # TODO This could be also a valid hid
+ local id=${cmd}
+
+ if zone_config_id_is valid ${zone} ${id} && [[ ${1} == "edit" ]]; then
+ shift 1
+ zone_config_edit "${zone}" "${id}""$@"
+ else
+ error "Unrecognized argument: ${cmd}"
+ cli_usage root-zone-config-subcommands
+ exit ${EXIT_ERROR}
+ fi
;;
esac
}