From: Jonatan Schlag Date: Wed, 5 Jul 2017 14:19:52 +0000 (+0200) Subject: zone: change edit syntax for config. X-Git-Tag: 009~187 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6a03d560a89a9a749f520fab6279a1f12a6520e;p=network.git zone: change edit syntax for config. The syntax to edit a config is now network zone upl0 config 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 Signed-off-by: Michael Tremer --- diff --git a/src/functions/functions.zone b/src/functions/functions.zone index 441bf5f8..776b63b0 100644 --- a/src/functions/functions.zone +++ b/src/functions/functions.zone @@ -556,9 +556,18 @@ zone_config() { 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 }