diff options
Diffstat (limited to 'templates/interfaces/ethernet')
4 files changed, 20 insertions, 8 deletions
diff --git a/templates/interfaces/ethernet/node.tag/bridge-group/bridge/node.def b/templates/interfaces/ethernet/node.tag/bridge-group/bridge/node.def index 9a071930..c6d2934a 100644 --- a/templates/interfaces/ethernet/node.tag/bridge-group/bridge/node.def +++ b/templates/interfaces/ethernet/node.tag/bridge-group/bridge/node.def @@ -1,11 +1,10 @@ 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(../../@)" delete:expression: "sudo brctl delif $VAR(@) $VAR(../../@)" allowed: local -a array ; array=( /sys/class/net/br* ) ; diff --git a/templates/interfaces/ethernet/node.tag/bridge-group/cost/node.def b/templates/interfaces/ethernet/node.tag/bridge-group/cost/node.def index f3ae520f..ef2d9940 100644 --- a/templates/interfaces/ethernet/node.tag/bridge-group/cost/node.def +++ b/templates/interfaces/ethernet/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/bridge-group/node.def b/templates/interfaces/ethernet/node.tag/bridge-group/node.def index fd392431..3cc92cd0 100644 --- a/templates/interfaces/ethernet/node.tag/bridge-group/node.def +++ b/templates/interfaces/ethernet/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(../@)" +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; " diff --git a/templates/interfaces/ethernet/node.tag/bridge-group/priority/node.def b/templates/interfaces/ethernet/node.tag/bridge-group/priority/node.def index 12200b72..8688c394 100644 --- a/templates/interfaces/ethernet/node.tag/bridge-group/priority/node.def +++ b/templates/interfaces/ethernet/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 |