diff options
author | Stig Thormodsrud <stig@vyatta.com> | 2008-04-14 15:09:01 -0700 |
---|---|---|
committer | Stig Thormodsrud <stig@vyatta.com> | 2008-04-14 15:09:01 -0700 |
commit | 4c42c6bde357423f0704a6e5b1ea70081944a1bb (patch) | |
tree | 763ed9e52cb3b6966ce97dd54964e5d1647e1ceb /templates/interfaces/ethernet | |
parent | fd65713869e3b665e8df5f7adf21cd550a84b184 (diff) | |
download | vyatta-cfg-quagga-4c42c6bde357423f0704a6e5b1ea70081944a1bb.tar.gz vyatta-cfg-quagga-4c42c6bde357423f0704a6e5b1ea70081944a1bb.zip |
Fix 3148: can't delete bridge interface
Diffstat (limited to 'templates/interfaces/ethernet')
-rw-r--r-- | templates/interfaces/ethernet/node.tag/bridge-group/node.def | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/templates/interfaces/ethernet/node.tag/bridge-group/node.def b/templates/interfaces/ethernet/node.tag/bridge-group/node.def index 3cc92cd0..0f4e9b2c 100644 --- a/templates/interfaces/ethernet/node.tag/bridge-group/node.def +++ b/templates/interfaces/ethernet/node.tag/bridge-group/node.def @@ -1,15 +1,20 @@ help: Add this interface to a bridge group -commit:expression: $VAR(./bridge/) != ""; "Must set the bridge interface" -create:expression: "sudo brctl addif $VAR(./bridge/@) $VAR(../@)" -delete:expression: "touch /tmp/eth-$VAR(../@)-bridge.$PPID" -end:expression: "\ - if [ -f \"/tmp/eth-$VAR(../@)-bridge.$PPID\" ]; then \ - rm -f /tmp/eth-$VAR(../@)-bridge.$PPID; \ - else \ - if [ -n \"$VAR(./cost/@)\" ]; then \ - sudo brctl setpathcost $VAR(./bridge/@) $VAR(../@) $VAR(./cost/@); \ - fi; \ - if [ -n \"$VAR(./priority/@)\" ]; then \ - sudo brctl setportprio $VAR(./bridge/@) $VAR(../@) $VAR(./priority/@); \ - fi; \ - fi; " + +create: sudo brctl addif $VAR(./bridge/@) $VAR(../@); + +delete: touch /tmp/eth-$VAR(../@)-bridge.$PPID; + +end: if [ -f "/tmp/eth-$VAR(../@)-bridge.$PPID" ]; then + rm -f /tmp/eth-$VAR(../@)-bridge.$PPID; + else + if [ -z "$VAR(./bridge/@)" ]; then + echo "Must set the bridge interface"; + exit 1; + fi; + if [ -n "$VAR(./cost/@)" ]; then + sudo brctl setpathcost $VAR(./bridge/@) $VAR(../@) $VAR(./cost/@); + fi; + if [ -n "$VAR(./priority/@)" ]; then + sudo brctl setportprio $VAR(./bridge/@) $VAR(../@) $VAR(./priority/@); + fi; + fi; |