2 .
/usr
/lib
/network
/network
5 # Returns 0 when a link is detected, 1 otherwise
8 if ip link show
$1|
grep -q "state UP"; then
20 # Add the master interface
21 ip link
set $INTERFACE up ||
return 1
25 ifenslave
-d $INTERFACE $S &>/dev
/null
26 ip link
set $S up ||
return 1
27 ifenslave
$INTERFACE $S ||
return 1
28 if [[ $slaves_up -eq 0 ]]; then
30 until ! ip link show
$S|
grep -q "state UP"; do
33 if [[ $timeout -eq 5 ]]; then
34 report_fail
"Slave $S is down"
38 if ! ip link show
$S|
grep -q "state UP"; then
44 # If no slave is up, abort
45 if [[ $slaves_up -eq 0 ]]; then
46 report_fail
"No slave up"
50 # Wait for the bonding interface to be up
51 while ! ip link show
$INTERFACE|
grep -q "state UP"; do
55 # Now do as if it were a simple ethernet interface
56 /usr
/lib
/network
/connections
/ethernet-iproute up
$1
64 ifenslave
-d $INTERFACE $S
65 ip link
set $S down ||
return 1
68 /usr
/lib
/network
/connections
/ethernet-iproute down
$1