mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-13 12:32:59 +02:00
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 <michael.tremer@ipfire.org> Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
This commit is contained in:
committed by
Arne Fitzenreiter
parent
3638d37c0d
commit
cacfaa1c89
@@ -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 "$(</sys/class/net/${INTERFACE}/address)" = "${slave}" ] || [ "${INTERFACE}" = "${slave}" ]; then
|
||||
if [ "$(cat /sys/class/net/${INTERFACE}/address 2>/dev/null)" = "${slave}" ] || [ "${INTERFACE}" = "${slave}" ]; then
|
||||
echo "${zone}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user