]> git.ipfire.org Git - people/ms/network.git/blobdiff - src/functions/functions.zone
zone: Automatically bring up all configs after creation
[people/ms/network.git] / 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() {