02_network 932 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/sh
  2. . /lib/functions/system.sh
  3. . /lib/functions/uci-defaults.sh
  4. ath79_setup_interfaces()
  5. {
  6. local board="$1"
  7. case "$board" in
  8. "ubnt,unifi")
  9. ucidef_set_interface_lan "eth0"
  10. ;;
  11. "tplink,tl-wr1043nd-v1")
  12. ucidef_add_switch "switch0" \
  13. "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
  14. ;;
  15. "netgear,wndr3800")
  16. ucidef_set_interfaces_lan_wan "eth0" "eth1"
  17. ucidef_add_switch "switch0" \
  18. "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5u@eth0"
  19. ucidef_add_switch_attr "switch0" "blinkrate" 2
  20. ucidef_add_switch_port_attr "switch0" 1 led 6
  21. ucidef_add_switch_port_attr "switch0" 2 led 9
  22. ucidef_add_switch_port_attr "switch0" 5 led 2
  23. ;;
  24. "buffalo,wzr-hp-g450h")
  25. ucidef_add_switch "switch0" \
  26. "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
  27. ;;
  28. *)
  29. ucidef_set_interfaces_lan_wan "eth0" "eth1"
  30. ;;
  31. esac
  32. }
  33. board_config_update
  34. board=$(board_name)
  35. ath79_setup_interfaces $board
  36. board_config_flush
  37. exit 0