From 44b8ade9e004339b06959347512523932f05b508 Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Sun, 6 Sep 2015 17:05:53 +0200 Subject: [PATCH] zone: Automatically bring up all configs after creation Signed-off-by: Stefan Schantl Signed-off-by: Michael Tremer --- src/functions/functions.zone | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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() { -- 2.39.2