diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2011-05-23 08:41:25 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2011-05-23 08:41:25 -0700 |
commit | 4344a5bcba4bde031a05573d024040d9dfdeac85 (patch) | |
tree | b91cd8ee6149abab2462ad8010e5609ac9080846 /templates/interfaces | |
parent | e23c47fdacd007b11b11ec49ab8e4cd41531326b (diff) | |
download | vyatta-cfg-quagga-4344a5bcba4bde031a05573d024040d9dfdeac85.tar.gz vyatta-cfg-quagga-4344a5bcba4bde031a05573d024040d9dfdeac85.zip |
don't assume hw-id exists since it can be deleted
Diffstat (limited to 'templates/interfaces')
-rw-r--r-- | templates/interfaces/ethernet/node.def | 6 |
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 |