- config_get mtu "$config" mtu
- config_get macaddr "$config" macaddr
- grep "$iface:" /proc/net/dev > /dev/null && \
- $DEBUG ifconfig "$iface" down && \
- $DEBUG ifconfig "$iface" ${macaddr:+hw ether "$macaddr"} ${mtu:+mtu $mtu} up
- set_interface_ifname "$config" "$iface"
+ grep "$iface_main:" /proc/net/dev > /dev/null && {
+ local mtu macaddr
+ config_get mtu "$config" mtu
+ config_get macaddr "$config" macaddr
+ [ -n "$macaddr" ] && $DEBUG ifconfig "$iface_main" down
+ $DEBUG ifconfig "$iface_main" ${macaddr:+hw ether "$macaddr"} ${mtu:+mtu $mtu} up
+ }
+ set_interface_ifname "$config" "$iface_main"