summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@vyatta.com>2008-02-26 13:05:40 -0800
committerStig Thormodsrud <stig@vyatta.com>2008-02-26 13:05:40 -0800
commit0225aa7954236999d2ce110093378880ba7b65f4 (patch)
tree25bc9b5ba60960dc0e44cec9511bc3c724357f28 /templates
parent6a340a5b34c14cd42625a56bcdb146f4549d606c (diff)
downloadvyatta-cfg-system-0225aa7954236999d2ce110093378880ba7b65f4.tar.gz
vyatta-cfg-system-0225aa7954236999d2ce110093378880ba7b65f4.zip
Fix 2877: Bridge group can not be assiged to vif sub interfaceZ
Diffstat (limited to 'templates')
-rw-r--r--templates/interfaces/ethernet/node.tag/vif/node.tag/bridge-group/bridge/node.def9
-rw-r--r--templates/interfaces/ethernet/node.tag/vif/node.tag/bridge-group/cost/node.def4
-rw-r--r--templates/interfaces/ethernet/node.tag/vif/node.tag/bridge-group/node.def13
-rw-r--r--templates/interfaces/ethernet/node.tag/vif/node.tag/bridge-group/priority/node.def4
4 files changed, 21 insertions, 9 deletions
diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/bridge-group/bridge/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/bridge-group/bridge/node.def
index fffa0eeb..9c65ff16 100644
--- a/templates/interfaces/ethernet/node.tag/vif/node.tag/bridge-group/bridge/node.def
+++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/bridge-group/bridge/node.def
@@ -1,12 +1,11 @@
type: txt
help: Add this interface to a bridge-group
-syntax:expression: exec " \
- if [ -z \"`sudo brctl show | grep $VAR(@) `\" ]; then \
+syntax:expression: exec " \
+ if [ -z \"`sudo brctl show | grep $VAR(@) `\" ]; then \
echo bridge interface $VAR(@) doesn\\'t exist on this system ; \
- exit 1 ; \
+ exit 1 ; \
fi ; "
-update:expression: "sudo brctl addif $VAR(@) $VAR(../../../../@).$VAR(../../@)"
-delete:expression: "sudo brctl delif $VAR(@) $VAR(../../../../@).$VAR(../../@)"
+delete:expression: "sudo brctl delif $VAR(@) $VAR(../../../@).$VAR(../../@)"
allowed: local -a array ;
array=( /sys/class/net/br* ) ;
echo -n ${array[@]##*/}
diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/bridge-group/cost/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/bridge-group/cost/node.def
index f3ae520f..ef2d9940 100644
--- a/templates/interfaces/ethernet/node.tag/vif/node.tag/bridge-group/cost/node.def
+++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/bridge-group/cost/node.def
@@ -1,4 +1,4 @@
type: u32
help: Set the path cost for this port
-commit:expression: $VAR(../bridge/) != ""; "Must configure bridge interface"
-update:expression: "sudo brctl setpathcost $VAR(../../@) $VAR(@)"
+comp_help: possible completions:
+ <0-2147483647> Set port cost
diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/bridge-group/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/bridge-group/node.def
index fd392431..af1c0e85 100644
--- a/templates/interfaces/ethernet/node.tag/vif/node.tag/bridge-group/node.def
+++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/bridge-group/node.def
@@ -1,2 +1,15 @@
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(../../@).$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(../@) $VAR(./cost/@); \
+ fi; \
+ if [ -n \"$VAR(./priority/@)\" ]; then \
+ sudo brctl setportprio $VAR(./bridge/@) $VAR(../../@).$VAR(../@) $VAR(./priority/@); \
+ fi; \
+ fi; "
diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/bridge-group/priority/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/bridge-group/priority/node.def
index 12200b72..8688c394 100644
--- a/templates/interfaces/ethernet/node.tag/vif/node.tag/bridge-group/priority/node.def
+++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/bridge-group/priority/node.def
@@ -1,4 +1,4 @@
type: u32
help: Set the path priority for this port
-commit:expression: $VAR(../bridge/) != ""; "Must configure bridge interface"
-update:expression: "sudo brctl setportprio $VAR(../../@) $VAR(@)"
+comp_help: possible completions:
+ <0-255> Set port priority