switch.sh 296 B

123456789101112131415
  1. #!/bin/sh
  2. # Copyright (C) 2009 OpenWrt.org
  3. setup_switch_dev() {
  4. local name
  5. config_get name "$1" name
  6. name="${name:-$1}"
  7. [ -d "/sys/class/net/$name" ] && ifconfig "$name" up
  8. swconfig dev "$name" load network
  9. }
  10. setup_switch() {
  11. config_load network
  12. config_foreach setup_switch_dev switch
  13. }