10-net 781 B

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