summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-07-31 21:59:46 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-07-31 23:06:28 -0700
commit1cb034ae31da409a541b2275f8a8ba45e9434f9f (patch)
tree15b422ed8f9dabae8e8996366ccc7f5043d07e8b /templates
parentc6b895817534113809c11c85d236d3170152df4f (diff)
downloadvyatta-cfg-system-1cb034ae31da409a541b2275f8a8ba45e9434f9f.tar.gz
vyatta-cfg-system-1cb034ae31da409a541b2275f8a8ba45e9434f9f.zip
BONDING: handle change of bond-group
Use similar action to new bridge-group Bug 4768
Diffstat (limited to 'templates')
-rw-r--r--templates/interfaces/ethernet/node.tag/bond-group/node.def13
1 files changed, 7 insertions, 6 deletions
diff --git a/templates/interfaces/ethernet/node.tag/bond-group/node.def b/templates/interfaces/ethernet/node.tag/bond-group/node.def
index 4c5c38c3..f65a9bde 100644
--- a/templates/interfaces/ethernet/node.tag/bond-group/node.def
+++ b/templates/interfaces/ethernet/node.tag/bond-group/node.def
@@ -3,9 +3,10 @@ help: Add this interface to a bonding group
commit:expression: exec \
"/opt/vyatta/sbin/vyatta-interfaces.pl --dev=$VAR(@) --check=bonding"
allowed: /opt/vyatta/sbin/vyatta-interfaces.pl --show=bonding
-create: sudo sh -c "ip link set $VAR(../@) down 2>/dev/null";
- sudo sh -c "echo +$VAR(../@) > /sys/class/net/$VAR(@)/bonding/slaves";
- sudo sh -c "ip link set $VAR(../@) up 2>/dev/null"
-
-delete: sudo sh -c "echo -$VAR(../@) > /sys/class/net/$VAR(@)/bonding/slaves"
-
+update: eth=$VAR(../@); new=$VAR(@)
+ old=`/opt/vyatta/sbin/vyatta-cli-expand-var.pl \$\(/interfaces/ethernet/$ethif/bond-group/@\)`
+ if [ -n "$old" ]; then
+ sudo ${vyatta_sbindir}/vyatta-bonding.pl --dev=$old --remove=$ethif
+ fi
+ sudo ${vyatta_sbindir}/vyatta-bonding.pl --dev=$new --add=$ethif
+delete: sudo ${vyatta_sbindir}/vyatta-bonding.pl --dev=$new --remove=$ethif