aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xinitramfs-init.in5
1 files changed, 4 insertions, 1 deletions
diff --git a/initramfs-init.in b/initramfs-init.in
index 413fa1d..fd3c50c 100755
--- a/initramfs-init.in
+++ b/initramfs-init.in
@@ -145,8 +145,11 @@ setup_inittab_console(){
# uses the first "eth" interface.
ip_choose_if() {
for x in /sys/class/net/eth*; do
- [ -e "$x" ] && echo ${x##*/} && return
+ if grep -iq up $x/operstate;then
+ [ -e "$x" ] && echo ${x##*/} && return
+ fi
done
+ [ -e "$x" ] && echo ${x##*/} && return
}
# ip_set <device> <ip> <netmask> <gateway-ip>