summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--templates/interfaces/bonding/node.def8
1 files changed, 7 insertions, 1 deletions
diff --git a/templates/interfaces/bonding/node.def b/templates/interfaces/bonding/node.def
index a0a56a8d..ece131b4 100644
--- a/templates/interfaces/bonding/node.def
+++ b/templates/interfaces/bonding/node.def
@@ -4,6 +4,12 @@ help: Set bonding interface
syntax:expression: pattern $VAR(@) "^bond[0-9]+$" \
; "bonding must be (bond0-bond99)"
create: ${vyatta_sbindir}/vyatta-bonding.pl --create $VAR(@)
-delete: ${vyatta_sbindir}/vyatta-bonding.pl --delete $VAR(@)
+delete: SLAVES=`cat /sys/class/net/$VAR(@)/bonding/slaves`;
+ if [ -z $SLAVES ]
+ then ${vyatta_sbindir}/vyatta-bonding.pl --delete $VAR(@)
+ else
+ echo "bonded interface $VAR(@) still has slaves: $SLAVES"
+ exit 1;
+ fi
end: ${vyatta_sbindir}/vyatta-bonding.pl --mode-change $VAR(@)
comp_help: Enter bond interface name (bond0 - bond99)