summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
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