use_vlan='false'
# enslave this interface to bond?
-if [ -e /tmp/bond.info ]; then
- . /tmp/bond.info
+for i in /tmp/bond.*.info; do
+ [ -e "$i" ] || continue
+ unset bondslaves
+ unset bondname
+ . "$i"
for slave in $bondslaves ; do
if [ "$netif" = "$slave" ] ; then
netif=$bondname
+ break 2
fi
done
-fi
+done
if [ -e /tmp/team.info ]; then
. /tmp/team.info
fi
# start bond if needed
-if [ -e /tmp/bond.info ]; then
- . /tmp/bond.info
+if [ -e /tmp/bond.${netif}.info ]; then
+ . /tmp/bond.${netif}.info
if [ "$netif" = "$bondname" ] && [ ! -e /tmp/net.$bondname.up ] ; then # We are master bond device
modprobe bonding
+ echo "+$netif" > /sys/class/net/bonding_masters
ip link set $netif down
# Stolen from ifup-eth
fi
# bond: attempt only the defined interface (override bridge defines)
- if [ -e /tmp/bond.info ]; then
- . /tmp/bond.info
+ for i in /tmp/bond.*.info; do
+ [ -e "$i" ] || continue
+ unset bondslaves
+ unset bondname
+ . "$i"
# It is enough to fire up only one
IFACES="$IFACES ${bondslaves%% *}"
- fi
+ done
if [ -e /tmp/team.info ]; then
. /tmp/team.info
fi
# Make it suitable for initscripts export
bondoptions=$(str_replace "$bondoptions" ";" ",")
- echo "bondname=$bondname" > /tmp/bond.info
- echo "bondslaves=\"$bondslaves\"" >> /tmp/bond.info
- echo "bondoptions=\"$bondoptions\"" >> /tmp/bond.info
+ echo "bondname=$bondname" > /tmp/bond.${bondname}.info
+ echo "bondslaves=\"$bondslaves\"" >> /tmp/bond.${bondname}.info
+ echo "bondoptions=\"$bondoptions\"" >> /tmp/bond.${bondname}.info
return
fi
unset bridgename ethnames
iface=eth0
-if [ -e /tmp/bond.info ]; then
- . /tmp/bond.info
- if [ -n "$bondname" ] ; then
- iface=$bondname
- fi
-fi
# Parse bridge for bridgename and ethnames
if bridge="$(getarg bridge)"; then
read IFACES < /tmp/net.ifaces
-if [ -e /tmp/bond.info ]; then
- . /tmp/bond.info
-fi
-
if [ -e /tmp/bridge.info ]; then
. /tmp/bridge.info
fi
# bridge?
unset bridge
unset bond
+ unset bondslaves
+ unset bondname
+ unset bondoptions
+ [ -e /tmp/bond.${netif}.info ] && . /tmp/bond.${netif}.info
+
uuid=$(cat /proc/sys/kernel/random/uuid)
if [ "$netif" = "$bridgename" ]; then
bridge=yes