def_set_interfaces_lan_wan.patch 621 B

123456789101112
  1. --- a/target/linux/x86/base-files/etc/board.d/02_network
  2. +++ b/target/linux/x86/base-files/etc/board.d/02_network
  3. @@ -22,6 +22,9 @@ traverse-technologies-geos)
  4. macaddr="$(cat /sys/class/net/eth0/address)" 2>/dev/null
  5. [ -n "$macaddr" ] && ucidef_set_interface_macaddr "wan" "$macaddr"
  6. ;;
  7. +*)
  8. + [ "$(ip address | grep ^[0-9] | awk -F: '{print $2}' | sed "s/ //g" | grep '^[e]' | grep -cvE "(@|\.)")" -gt 2 ] && ucidef_set_interfaces_lan_wan "$(ip address | grep ^[0-9] | awk -F: '{print $2}' | sed "s/ //g" | grep '^[e]' | grep -vE "(@|\.|eth1)" | tr "\n" " " | sed "s/ $//")" "eth1"
  9. + ;;
  10. esac
  11. board_config_flush