]> git.ipfire.org Git - people/stevee/network.git/commitdiff
zone: Automatically bring up all configs after creation
authorStefan Schantl <stefan.schantl@ipfire.org>
Sun, 6 Sep 2015 15:05:53 +0000 (17:05 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Sun, 6 Sep 2015 15:05:53 +0000 (17:05 +0200)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/functions/functions.zone

index 6b9245984919ba5bded6d6d31283b76c0f03a238..e740a1a749a3713352f084162b41ea958e5d6c79 100644 (file)
@@ -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() {