diff options
Diffstat (limited to 'templates/interfaces/ethernet/node.def')
-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 |