#!/bin/bash

. $SCRIPTDIR/functions
pickup_options

# TODO: max_bonds=1 to override modules.conf?
$INSMOD bonding -o $NAME mode=${BONDMODE:-$DEFAULT_BONDMODE} $BONDOPTIONS >/dev/null

# We assume that there is no other bonding modules hanging around.
# TODO: compute iface table difference and find newly appeared iface.
# We must assign bond IP address before calling ifenslave.
$IP link set bond0 name $NAME
