diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-07-31 21:59:46 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-07-31 22:27:00 -0700 |
commit | 0f402acf382c7e27c130c7d75a5886d0150e8d0e (patch) | |
tree | c7b146a1e26c610a51d1bd404ba7dca488c2dc74 /templates | |
parent | c6b895817534113809c11c85d236d3170152df4f (diff) | |
download | vyatta-cfg-system-0f402acf382c7e27c130c7d75a5886d0150e8d0e.tar.gz vyatta-cfg-system-0f402acf382c7e27c130c7d75a5886d0150e8d0e.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.def | 17 |
1 files changed, 11 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..d2a398a1 100644 --- a/templates/interfaces/ethernet/node.tag/bond-group/node.def +++ b/templates/interfaces/ethernet/node.tag/bond-group/node.def @@ -3,9 +3,14 @@ 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" - +end: ethif=$VAR(../@) + old=`/opt/vyatta/sbin/vyatta-cli-expand-var.pl \$\(/interfaces/ethernet/$ethif/bond-group/@\)` + new=$VAR(@) + if [ ${COMMIT_ACTION} = 'SET' ]; then + sudo ${vyatta_sbindir}/vyatta-bonding.pl --dev=$new --add=$ethif + elif [ ${COMMIT_ACTION} = 'DELETE' ]; then + sudo ${vyatta_sbindir}/vyatta-bonding.pl --dev=$new --remove=$ethif + elif [ "$old" != "$new" ]; then + sudo ${vyatta_sbindir}/vyatta-bonding.pl --dev=$old --remove=$ethif + sudo ${vyatta_sbindir}/vyatta-bonding.pl --dev=$new --add=$ethif + fi |