}
scan_interfaces() {
+ local cfgfile="$1"
local mode iftype iface ifname device
interfaces=
config_cb() {
;;
esac
}
- config_load network
+ config_load "${cfgfile:-network}"
}
add_vlan() {
# to create any interfaces here. The scripts have already done that, otherwise
# the bridge interface wouldn't exist.
[ "$iface" = "br-$config" ] && return 0;
+
+ [ -f "$iface" ] && return 0;
ifconfig "$iface" 2>/dev/null >/dev/null && {
# make sure the interface is removed from any existing bridge and brought down
# Setup VLAN interfaces
add_vlan "$iface"
+ ifconfig "$iface" 2>/dev/null >/dev/null || return 0
# Setup bridging
config_get iftype "$config" type
done
}
- env -i ACTION="ifup" INTERFACE="$config" DEVICE="$iface" PROTO=static /sbin/hotplug "iface" &
+ env -i ACTION="ifup" INTERFACE="$config" DEVICE="$iface" PROTO=static /sbin/hotplug-call "iface" &
;;
dhcp)
# prevent udhcpc from starting more than once
unbridge() {
local dev="$1"
local brdev
-
+
+ [ -x /usr/sbin/brctl ] || return 0
brctl show | grep "$dev" >/dev/null && {
# interface is still part of a bridge, correct that