mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-16 14:03:00 +02:00
network-hotplug-bridges: Fix warning when address doesn't exist
Some devices do not have an address, which prints an error when reading it. 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
546119da9e
commit
58d471a4a8
@@ -41,9 +41,8 @@ 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
|
||||
|
||||
#Compare if the mac address matches or if the name matches
|
||||
if ([ "$(</sys/class/net/${INTERFACE}/address)" = "${slave}" ] || [ "${INTERFACE}" = "${slave}" ]); then
|
||||
# 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
|
||||
echo "${zone}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user