admswswitch.sh 456 B

12345678910111213141516171819202122232425262728
  1. #!/bin/sh
  2. # Copyright (C) 2006 OpenWrt.org
  3. setup_switch_vlan() {
  4. config_get ports "$CONFIG_SECTION" "eth$1"
  5. ports=`echo "$ports"| sed s/" "/""/g`
  6. ifconfig eth$1 down
  7. admswconfig eth$1 ${ports}c
  8. ifconfig eth$1 up
  9. }
  10. setup_switch() {
  11. config_cb() {
  12. case "$1" in
  13. switch)
  14. option_cb() {
  15. case "$1" in
  16. eth*) setup_switch_vlan "${1##eth}";;
  17. esac
  18. }
  19. ;;
  20. *)
  21. option_cb() { return 0; }
  22. ;;
  23. esac
  24. }
  25. config_load network
  26. }