summaryrefslogtreecommitdiff
path: root/templates/interfaces/bridge
diff options
context:
space:
mode:
Diffstat (limited to 'templates/interfaces/bridge')
-rw-r--r--templates/interfaces/bridge/node.tag/address/node.def6
-rw-r--r--templates/interfaces/bridge/node.tag/disable/node.def18
2 files changed, 17 insertions, 7 deletions
diff --git a/templates/interfaces/bridge/node.tag/address/node.def b/templates/interfaces/bridge/node.tag/address/node.def
index 3f04ec06..6e07ea7f 100644
--- a/templates/interfaces/bridge/node.tag/address/node.def
+++ b/templates/interfaces/bridge/node.tag/address/node.def
@@ -2,8 +2,10 @@ multi:
type: txt
help: Set an IP address for this interface
syntax:expression: exec "/opt/vyatta/sbin/vyatta-interfaces.pl --valid-addr $VAR(@) --dev $VAR(../@)"; "Invalid IP address/prefix [$VAR(@)] for interface $VAR(../@)"
-update:expression: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-update $VAR(@) --dev $VAR(../@)"; "Error setting address $VAR(@) on interface $VAR(../@)"
-delete:expression: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-delete $VAR(@) --dev $VAR(../@)"; "Error deleting address $VAR(@) on interface $VAR(../@)"
+update:expression: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-update $VAR(@) --dev $VAR(../@) \
+--intf-cli-path \"interfaces bridge $VAR(../@)\""; "Error setting address $VAR(@) on interface $VAR(../@)"
+delete:expression: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-delete $VAR(@) --dev $VAR(../@) \
+--intf-cli-path \"interfaces bridge $VAR(../@)\""; "Error deleting address $VAR(@) on interface $VAR(../@)"
allowed: echo "dhcp <>"
comp_help:Possible completions:
<x.x.x.x/x> Set the IP address and prefix length
diff --git a/templates/interfaces/bridge/node.tag/disable/node.def b/templates/interfaces/bridge/node.tag/disable/node.def
index 3aa26012..f4495164 100644
--- a/templates/interfaces/bridge/node.tag/disable/node.def
+++ b/templates/interfaces/bridge/node.tag/disable/node.def
@@ -1,11 +1,19 @@
type: bool
help: Disable the bridge interface
default: false
-update:expression: "if [ x$VAR(@) == xtrue ]; then \
- sudo ip link set $VAR(../@) down; \
- else \
- sudo ip link set $VAR(../@) up; \
- fi; "
+update: if [ x$VAR(@) == xtrue ]; then
+ /etc/netplug/linkdown.d/dhclient $VAR(../@)
+ if ! sudo ip link set $VAR(../@) down 2>/dev/null; then
+ echo "Error disabling dev $VAR(../@)"
+ /etc/netplug/linkup.d/dhclient $VAR(../@)
+ exit 1
+ fi
+ else
+ if ! sudo ip link set $VAR(../@) up; then
+ echo "Error enabling dev $VAR(../@)"
+ exit 1
+ fi
+ fi
comp_help: possible completions:
true Disable the bridge interface
false Enable the bridge interface (default)