10-net 658 B

1234567891011121314151617181920212223242526272829303132333435
  1. # Copyright (C) 2006 OpenWrt.org
  2. include /lib/network
  3. addif() {
  4. scan_interfaces
  5. local cfg="$(find_config "$INTERFACE")"
  6. # check the autoload setting
  7. config_get auto "$cfg" auto
  8. case "$auto" in
  9. 1|on|enabled) setup_interface "$INTERFACE";;
  10. esac
  11. # find all vlan configurations for this interface and set them up as well
  12. for ifc in $interfaces; do
  13. config_get iftype "$ifc" type
  14. config_get ifs "$ifc" device
  15. for dev in $ifs; do
  16. [ "${dev%%\.*}" = "$INTERFACE" -a "$dev" != "$INTERFACE" ] && {
  17. add_vlan "$dev"
  18. }
  19. done
  20. done
  21. }
  22. case "$ACTION" in
  23. add|register)
  24. case "$PHYSDEVDRIVER" in
  25. natsemi) sleep 1;;
  26. esac
  27. addif
  28. ;;
  29. esac