From: Michael Tremer Date: Thu, 17 Oct 2024 14:54:15 +0000 (+0000) Subject: udev: network-hotplug-bridges: Silence a warning when interfaces have gone away X-Git-Tag: v2.29-core190~37 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cacfaa1c890b024302ba9a861bc98b0ac365e405;p=ipfire-2.x.git udev: network-hotplug-bridges: Silence a warning when interfaces have gone away It can happen that udev has an event for an interface in the queue that has already gone away - or even just being renamed. Then reading the MAC address fails. Because the shell expands the "$(<...)" statement before running the whole line, the read check is useless. Because the code would get too complicated otherwise, I decided to use cat. Not cool, but this does the job. Signed-off-by: Michael Tremer Signed-off-by: Arne Fitzenreiter --- diff --git a/config/udev/network-hotplug-bridges b/config/udev/network-hotplug-bridges index 9fded1fd03..39faeb5a9e 100644 --- a/config/udev/network-hotplug-bridges +++ b/config/udev/network-hotplug-bridges @@ -42,7 +42,7 @@ detect_zone() { local slave for slave in $(get_value "${zone}_SLAVES"); do # Compare if the mac address matches or if the name matches - if [ -r "/sys/class/net/${INTERFACE}/address" -a "$(/dev/null)" = "${slave}" ] || [ "${INTERFACE}" = "${slave}" ]; then echo "${zone}" return 0 fi