+function zone_enable() {
+ # This function will enable the zone
+ # with help of systemd.
+
+ local zone="${1}"
+ assert zone_exists "${zone}"
+
+ # Enable service for the zone
+ service_enable "network@${zone}.service"
+ local ret=$?
+
+ if [ ${ret} -eq ${EXIT_OK} ]; then
+ log INFO "Auto-start enabled for zone ${zone}"
+ return ${EXIT_OK}
+ fi
+
+ log ERROR "Could not enable zone ${zone}: ${ret}"
+ return ${ret}
+}
+
+function zone_disable() {
+ # This function will disable the zone
+ # with help of systemd.
+
+ local zone="${1}"
+ assert zone_exists "${zone}"
+
+ # Disable service for the zone
+ service_disable "network@${zone}.service"
+ local ret=$?
+
+ if [ ${ret} -eq ${EXIT_OK} ]; then
+ log INFO "Auto-start disabled for zone ${zone}"
+ return ${EXIT_OK}
+ fi
+
+ log ERROR "Could not disable zone ${zone}: ${ret}"
+ return ${ret}
+}
+
+function zone_is_enabled() {
+ local zone="${1}"
+ assert isset zone
+
+ # Ask systemd if the zone is enabled.
+ if service_is_enabled "network@${zone}.service"; then
+ return ${EXIT_TRUE}
+ fi
+
+ return ${EXIT_FALSE}
+}
+