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