#! /bin/sh
#
# Attempt to load the ethernet card module
#

XPWD=`pwd`
cd /lib/modules/*/kernel/drivers/net

echo "Finding network module"

modprobe mii 2>/dev/null >/dev/null
modprobe 8390 2>/dev/null >/dev/null

for card in *.o */*.o; do
  if insmod ${card} >/dev/null 2>&1 ; then                                
     if ifconfig eth0 >/dev/null 2>&1 ; then
        cat >>/etc/modules.conf <<EOF
alias eth0 $card
EOF
         echo "Ethernet card eth0 is a $card"
         sleep 2
         exit
      fi
  fi
done
echo "Sorry no ethernet card module found."
sleep 3
