summaryrefslogtreecommitdiff
path: root/templates/interfaces/ethernet
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2011-05-23 08:41:25 -0700
committerAn-Cheng Huang <ancheng@vyatta.com>2011-05-23 08:41:25 -0700
commit4344a5bcba4bde031a05573d024040d9dfdeac85 (patch)
treeb91cd8ee6149abab2462ad8010e5609ac9080846 /templates/interfaces/ethernet
parente23c47fdacd007b11b11ec49ab8e4cd41531326b (diff)
downloadvyatta-cfg-system-4344a5bcba4bde031a05573d024040d9dfdeac85.tar.gz
vyatta-cfg-system-4344a5bcba4bde031a05573d024040d9dfdeac85.zip
don't assume hw-id exists since it can be deleted
Diffstat (limited to 'templates/interfaces/ethernet')
-rw-r--r--templates/interfaces/ethernet/node.def6
1 files changed, 4 insertions, 2 deletions
diff --git a/templates/interfaces/ethernet/node.def b/templates/interfaces/ethernet/node.def
index 0b55de8a..a9113e7a 100644
--- a/templates/interfaces/ethernet/node.def
+++ b/templates/interfaces/ethernet/node.def
@@ -15,12 +15,14 @@ syntax:expression: exec \
begin: rm -f /tmp/speed-duplex.$VAR(@)
if [ -d "/sys/class/net/$VAR(@)" ]; then
- # assume hw-id always exists (as orig impl did)
s_mac="$VAR(hw-id/@)"
if [ -n "$VAR(mac/@)" ]; then
s_mac="$VAR(mac/@)"
fi
- /opt/vyatta/sbin/vyatta-interfaces.pl --dev $VAR(@) --set-mac $s_mac
+ if [ -n "$s_mac" ]; then
+ /opt/vyatta/sbin/vyatta-interfaces.pl --dev $VAR(@) \
+ --set-mac $s_mac
+ fi
fi
create: ip link set "$VAR(@)" up