From: Stefan Schantl Date: Sun, 6 Sep 2015 15:05:53 +0000 (+0200) Subject: zone: Automatically bring up all configs after creation X-Git-Tag: 007~8 X-Git-Url: http://git.ipfire.org/?p=people%2Fms%2Fnetwork.git;a=commitdiff_plain;h=44b8ade9e004339b06959347512523932f05b508 zone: Automatically bring up all configs after creation Signed-off-by: Stefan Schantl Signed-off-by: Michael Tremer --- diff --git a/src/functions/functions.zone b/src/functions/functions.zone index 6b924598..e740a1a7 100644 --- a/src/functions/functions.zone +++ b/src/functions/functions.zone @@ -508,7 +508,18 @@ zone_config_cmd() { } zone_config_new() { - zone_config_cmd "new" "$@" + local zone="${1}" + shift + + # Create a new configuration, but exit when that was + # not successful. + zone_config_cmd "new" "${zone}" "$@" || return ${?} + + # If the config could be created, we will try to bring + # it up if the zone is up, too. + if zone_is_up "${zone}"; then + zone_configs_up "${zone}" + fi } zone_config_destroy() {