02_network 628 B

12345678910111213141516171819202122232425262728
  1. #!/bin/sh
  2. . /lib/functions/uci-defaults.sh
  3. board_config_update
  4. if [ -e "/sys/bus/mdio_bus/drivers/IC+ IP175C/0:00" -o \
  5. -e "/sys/bus/mdio_bus/drivers/IC+ IP17xx/0:00" ] && \
  6. [ -x /sbin/swconfig ];
  7. then
  8. ucidef_add_switch "eth0" \
  9. "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "5@eth0"
  10. elif [ -e "/sys/bus/mdio_bus/drivers/Infineon ADM6996/0:00" -o \
  11. -e "/sys/bus/mdio_bus/drivers/Marvell 88E6060/0:10" ];
  12. then
  13. ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
  14. elif [ -d /sys/class/net/eth1 ]; then
  15. ucidef_set_interfaces_lan_wan "eth0" "eth1"
  16. else
  17. ucidef_set_interface_lan "eth0"
  18. fi
  19. board_config_flush
  20. exit 0