05_init_interfaces_brcm 371 B

12345678910111213141516
  1. #!/bin/sh
  2. preinit_iface() {
  3. ifname=eth0
  4. # hardware specific overrides
  5. case "$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /machine/ {print $2}' /proc/cpuinfo)" in
  6. "Asus WLHDD") ifname=eth1;;
  7. "Asus WL300G") ifname=eth1;;
  8. esac
  9. local try=0;
  10. while [ $((try++)) -le 5 ] && [ ! -f /sys/class/net/$ifname/operstate ]; do sleep 1; done
  11. }
  12. boot_hook_add preinit_main preinit_iface