From: Michael Tremer Date: Sat, 6 Sep 2014 08:42:07 +0000 (+0200) Subject: Only enable auto-enabled zones on hotplug events X-Git-Tag: 007~90 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0eb236f4fc3e879d67e056e2551401f4086b7e56;p=network.git Only enable auto-enabled zones on hotplug events --- diff --git a/src/udev/network-hotplug b/src/udev/network-hotplug index df791d38..7b664a9f 100644 --- a/src/udev/network-hotplug +++ b/src/udev/network-hotplug @@ -90,10 +90,10 @@ case "${ACTION}" in # If not, there is nothing to do. isset zone || exit ${EXIT_OK} - # If the zone is already up, we add the device - # to the zone. - if zone_is_up ${zone}; then - zone_up ${zone} + # If the zone is already up or enabled for auto-start, + # we add the device to the zone. + if zone_is_up "${zone}" || zone_is_enabled "${zone}"; then + zone_up "${zone}" fi ;; diff --git a/src/udev/network-hotplug-serial b/src/udev/network-hotplug-serial index 61337022..1dbe89fd 100644 --- a/src/udev/network-hotplug-serial +++ b/src/udev/network-hotplug-serial @@ -90,7 +90,10 @@ case "${ACTION}" in isset sim_imsi || exit ${EXIT_OK} for zone in $(zones_get_all); do - # XXX Check if the zone is enabled. + # Skip zones that are not enabled for auto-start. + if ! zone_is_enabled "${zone}"; then + continue + fi # Skip unsupported hook types. hook="$(zone_get_hook "${zone}")"