summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorJohn Southworth <john.southworth@vyatta.com>2011-09-27 13:58:54 -0500
committerJohn Southworth <john.southworth@vyatta.com>2011-09-27 13:58:54 -0500
commitc2cacfe95ea51e8957e2885750fbe459d17ce229 (patch)
treeaeaeffb5671cde33d1032abf5c0510c7b8e5972c /templates
parent0858775c33517cbabe3d07e1c36b79f34bf8e4ca (diff)
downloadvyatta-cfg-quagga-c2cacfe95ea51e8957e2885750fbe459d17ce229.tar.gz
vyatta-cfg-quagga-c2cacfe95ea51e8957e2885750fbe459d17ce229.zip
Bugfix 7492: Reset mac address to hw-id when the mac is deleted
Diffstat (limited to 'templates')
-rw-r--r--templates/interfaces/ethernet/node.def13
1 files changed, 9 insertions, 4 deletions
diff --git a/templates/interfaces/ethernet/node.def b/templates/interfaces/ethernet/node.def
index 45d6ec09..e51fe7df 100644
--- a/templates/interfaces/ethernet/node.def
+++ b/templates/interfaces/ethernet/node.def
@@ -14,12 +14,17 @@ syntax:expression: exec \
fi"
begin: rm -f /tmp/speed-duplex.$VAR(@)
- if [ -n "$VAR(mac/@)" ] &&
- [ -d "/sys/class/net/$VAR(@)" ]; then
- /opt/vyatta/sbin/vyatta-interfaces.pl --dev $VAR(@) \
- --set-mac "$VAR(mac/@)"
+ if [ -d "/sys/class/net/$VAR(@)" ]; then
+ if [ -n "$VAR(mac/@)" ]; then
+ /opt/vyatta/sbin/vyatta-interfaces.pl --dev $VAR(@) \
+ --set-mac "$VAR(mac/@)"
+ else
+ /opt/vyatta/sbin/vyatta-interfaces.pl --dev $VAR(@) \
+ --set-mac "$VAR(hw-id/@)"
+ fi
fi
+
create: if ! cli-shell-api exists interfaces ethernet $VAR(@) disable;
then ip link set $VAR(@) up
fi