]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - config/udev/network-hotplug-bridges
Update translations
[ipfire-2.x.git] / config / udev / network-hotplug-bridges
index ff6d20a8b2be69837a8f3eeb433bf225bf85a487..5144a7712d5fedc82e0cd482148e65c0ab79202b 100644 (file)
@@ -26,7 +26,8 @@
 eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
 
 detect_zone() {
-       local intf="${INTERFACE%0*}"
+       local intf="${INTERFACE%?}"
+       intf="${intf%phys}"
        intf="${intf^^}"
 
        local zone
@@ -40,7 +41,9 @@ detect_zone() {
                # Try to find out if this INTERFACE is a slave of a zone
                local slave
                for slave in $(get_value "${zone}_SLAVES"); do
-                       if [ "${INTERFACE}" = "${slave}" ]; then
+
+                       #Compare if the mac address matches or if the name matches
+                       if ([ "$(</sys/class/net/${INTERFACE}/address)" = "${slave}" ] || [ "${INTERFACE}" = "${slave}" ]); then
                                echo "${zone}"
                                return 0
                        fi